Cryptography indexing the hash and primeality testing

In summary, cryptography indexing is the process of creating a unique identifier for information using mathematical algorithms. Hash indexing uses a mathematical function to convert a variable-length input into a fixed-length output, which can be used as a digital fingerprint for the information. Primeality testing is the process of determining whether a given number is a prime number or not and is crucial in cryptography because prime numbers are used in encryption algorithms. Primeality testing is performed using various algorithms, such as the Lucas-Lehmer test or the Miller-Rabin test. It is important in cryptography to ensure the security and integrity of encrypted data by avoiding the use of non-prime numbers, which can weaken the encryption process.
  • #1
qpwimblik
38
0
+David West

Heres What I got as far as the hash is concerned.
Heres my indexing functions

First We Have this function for fast indexing of the hash.

ZequebaHashB[bvc_, yvc_, avc_] :=
{Drop[Flatten[Reap[
Module[{a34 = bvc, a35 = yvc, rt2 = avc, z75, zler},
z75 = 1;
zler = Total[BCC[Re[Floor[Px[a34, a35^2]]], a35^3]];
Label[Start5629];
Sow[Denominator[zler/FiveItt[a35, z75]], yvc];
z75 = z75 + 1;
If[z75 >= rt2 + 1, Goto[end5629]];
Goto[Start5629];
Label[end5629];
];]], 1], Total[BCC[Floor[Re[Px[bvc, yvc^2]]], yvc^3]], bvc};Second we have this function for Getting a Rainbow Index of the hashRainbowHashXG[zf_, xz_, zd_, fd_] :=
Column[{Table[
Flatten[Drop[ZequebaHashB[RS[zf, 5] + xf, xz, zd], -2]], {xf, 0,
fd - 1}], zf}];

Now When you try these functions

Table[ZequebaHashB[Hash[xu, "SHA512"], 2, 5], {xu, 1, 10}]

{{{1, 2, 3, 4, 5}, 427,
12579926171497332473039920596952835386489858401292624452730263741969\
1347390182282976402981790496477460666208142347425205936701161323553455\
43156774710409041},
{{1, 1, 1, 1, 5}, 396,
37854471215291391986149267401049113295567628473597440675968265868739\
3920246834469920751231286910611366704757913119360843344094113813460828\
6029275267369625},
{{1, 1, 1, 2, 5}, 378,
71668700870008575285238318023246235316098096074289026150051114683524\
8893999285271969471146596174190457020264703584540790263678736452792747\
5984118971455163},
{{1, 2, 3, 4, 5}, 377,
33095966240281217830184164668404219514626500609945265788213543056523\
6612792119604718913684957565086394439681603253709963629672412822522528\
4694992131191098},
{{1, 2, 1, 4, 5}, 363,
86087420302049294430262146818103852368792727362988712093781053088200\
5531339261473092981846995901587757487311471069416835834626804973821926\
684090578667825},
{{1, 1, 3, 2, 5}, 374,
18586086601485268646467765285794047467027639305129763019055665664163\
2819380637531124748570695025942793945139516664108034654512831533948189\
743738184270224},
{{1, 1, 3, 1, 1}, 380,
72109882448403363840259529414390721196358024901859951350044294221621\
3409708767088486766304397692430037767785681544787701437132358156239382\
5256452011168475},
{{1, 2, 3, 4, 5}, 397,
22760214977694020069971224118591466739483553732805530503408373418535\
1711847169063849360187954434350675389187296376543635586233555068331343\
3001046271103001},
{{1, 2, 1, 4, 5}, 369,
11906459655144790308170064541982556680120578173098014909650827827844\
2313493552143468785692756291539132782149145837942478466345517803751070\
21641806135272354},
{{1, 1, 3, 2, 5}, 382,
88155955858214177781767282869972903505820511583564376117417944351446\
8458315518532665921338085983977628624644833036888032312932654944528755\
5410805140620789}}Table[RainbowHashXG[Hash[xu, "SHA512"], 2, 5, 5], {xu, 1, 10}]

{{{{1, 1, 1, 1, 5}, {1, 2, 3, 4, 5}, {1, 1, 3, 2, 5}, {1, 2, 1, 4, 1}, {1, 1, 3, 1, 5}},
12579926171497332473039920596952835386489858401292624452730263741969\
1347390182282976402981790496477460666208142347425205936701161323553455\
43156774710409041},
{{{1, 2, 1, 4, 5}, {1, 1, 3, 2, 5}, {1, 2, 3, 4, 1}, {1, 1, 1, 1, 5}, {1, 2, 3, 4, 5}},
37854471215291391986149267401049113295567628473597440675968265868739\
3920246834469920751231286910611366704757913119360843344094113813460828\
6029275267369625},
{{{1, 2, 3, 4, 5}, {1, 1, 1, 1, 5}, {1, 2, 3, 4, 5}, {1, 1, 3, 2, 5}, {1, 2, 1, 4, 1}},
71668700870008575285238318023246235316098096074289026150051114683524\
8893999285271969471146596174190457020264703584540790263678736452792747\
5984118971455163},
{{{1, 2, 3, 4, 5}, {1, 1, 1, 1, 5}, {1, 2, 3, 4, 5}, {1, 1, 3, 2, 1}, {1, 2, 1, 4, 5}},
33095966240281217830184164668404219514626500609945265788213543056523\
6612792119604718913684957565086394439681603253709963629672412822522528\
4694992131191098},
{{{1, 2, 3, 4, 1}, {1, 1, 3, 1, 5}, {1, 2, 1, 4, 5}, {1, 1, 3, 2, 5}, {1, 1, 3, 1, 5}},
86087420302049294430262146818103852368792727362988712093781053088200\
5531339261473092981846995901587757487311471069416835834626804973821926\
684090578667825},
{{{1, 1, 1, 1, 5}, {1, 2, 3, 4, 5}, {1, 1, 3, 2, 5}, {1, 2, 1, 4, 1}, {1, 1, 3, 1, 5}},
18586086601485268646467765285794047467027639305129763019055665664163\
2819380637531124748570695025942793945139516664108034654512831533948189\
743738184270224},
{{{1, 2, 3, 4, 1}, {1, 1, 1, 2, 5}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}, {1, 1, 3, 2, 5}},
72109882448403363840259529414390721196358024901859951350044294221621\
3409708767088486766304397692430037767785681544787701437132358156239382\
5256452011168475},
{{{1, 1, 3, 1, 5}, {1, 2, 3, 4, 1}, {1, 1, 1, 2, 5}, {1, 2, 3, 4, 5}, {1, 1, 3, 1, 5}},
22760214977694020069971224118591466739483553732805530503408373418535\
1711847169063849360187954434350675389187296376543635586233555068331343\
3001046271103001},
{{{1, 1, 1, 2, 5}, {1, 2, 3, 4, 5}, {1, 1, 3, 1, 1}, {1, 2, 1, 4, 5}, {1, 2, 1, 4, 1}},
11906459655144790308170064541982556680120578173098014909650827827844\
2313493552143468785692756291539132782149145837942478466345517803751070\
21641806135272354},
{{{1, 2, 1, 4, 5}, {1, 1, 3, 1, 1}, {1, 2, 3, 4, 5}, {1, 1, 1, 2, 5}, {1, 2, 3, 4, 5}},
88155955858214177781767282869972903505820511583564376117417944351446\
8458315518532665921338085983977628624644833036888032312932654944528755\

Heres what I have regarding primality testing It seems If I can kind of tell if a number is a composite or prime very Quickly once I've done some more tweaking and not only that differnt types of composites seem to yeild different behavours too. I might be very close to fast prime factorisation or at least a very fast probable prime test that can even be done quickly on numbers with 100's of millions of digits long evn a billion digits long quickly with a good GPU once coded properly for.

The Results
First
Comparing Primes with Compisites

{{{0, -2, 0, 2}, {0, 0, 0, 1,0}}, {{-2, 0, 1, -1}, {0, 0, 1, 1, 0}}},
{{{-2, 0, 2, 0}, {0, 0,0, 0, 0}}, {{0, 2, 0, 0}, {0, 0, 1, 1, 0}}},
{{{0, -2, 0, 2}, {0, 0, 0, 0, 0}}, {{2, 0, 1, -1}, {0, 0, 1, -1, -1}}},
{{{2, 0, 0,2}, {0, 0, 0, 0, 0}}, {{0, 2, 0, 2}, {0, 0, -1, -1,0}}},
{{{0, -2, 2, 0}, {0, 0, 1, 0, 0}}, {{0, -2, -2, 0}, {0, 0,0, 1, 0}}},
{{{-2, 0, 2, 0}, {0, 0, 0, 0, 0}}, {{2, 0, 0, 0}, {0, 0, 1, -1, 0}}},
{{{2, 0, 0, -2}, {0, 0, 0, 0, 0}}, {{0, 2, 1,1}, {0, 0, -1, 1, 0}}},
{{{2, 0, 2, 0}, {0, 0, 0, 1, 0}}, {{0, 2, 1, 1}, {0, 0, 1, 1, 0}}},
{{{0, -2, 2, 0}, {0, 0, 0, 0, 0}}, {{-2, 0, 1, -1}, {0, 0, -1, 0, 0}}},
{{{0, 2, 0, 2}, {0, 0, 0, 1, 1}}, {{0, 2, 1, -1}, {0, 0, 1, 1, 0}}}

Now Comparing 3 Prime Composites with 2 Prime Composites
{{{0, 2, 0, -2}, {-1, -1, 1, 0, 1}}, {{0, 2, 2, 0}, {-1, 1, -1, 0, 0}}},
{{{2, 0, 0, -2}, {0, -1, 0, 0, -1}}, {{0, 2, 2, 0}, {-1, -1,1, 0, 0}}},
{{{0, -2, 0, -2}, {0, 0, 0, 0, 1}}, {{-2, 0, 2, 0}, {1, 0, -1, 1, 0}}},
{{{-2, 0, 2, 0}, {1, 0, 0, 0, 0}}, {{0, -2, -2, 0}, {0, 0, -1, 1, 0}}},
{{{2, 0, 0, -2}, {1, 1, -1, 0, -1}}, {{0,2, 2, 0}, {0, -1, -1, -1, 0}}},
{{{-2, 0, -2, 0}, {-1, 0, 0, 0, 0}}, {{0, -2, 0, 2}, {0, 0, 1, 0, 0}}}

Now the MatheMatica Code I used

FiveItt[x98_, cc5_] :=
DifferenceRoot[
Function[{\[FormalY], \[FormalN]}, {-cc5 -
cc5 \[FormalY][\[FormalN]] + \[FormalY][1 + \[FormalN]] ==
0, \[FormalY][1] == 1, \[FormalY][2] == cc5}]][x98];

BCC[x55_, g77_] :=
Drop[Flatten[Reap[
Module[
{x45 = x55, z7 = 0, z8 = 0, z9, g7 = g77, bell},

z7 =
If[x45/FiveItt[Length[IntegerDigits[x45, g7]], g7] <= 1,
If[x45 == 1, 1, Length[IntegerDigits[x45, g7]] - 1],
Length[IntegerDigits[x45, g7]]];
bell = FiveItt[z7 - 1, g7];
z9 = g7^(z7 - 1);

Label[SPo];
z8 =
If[IntegerQ[x45/g7] && x45 > g7,
Quotient[x45 - bell - (1/(2*g7)), z9],
If[x45 <= g7, x45, Quotient[x45 - bell, z9]]];
Sow[z8];
x45 = x45 - (z8*(z9));
z7 = z7 - 1;
z9 = z9/g7;
bell = bell - z9;

If[z7 < 1, Goto[EnD], Goto[SPo]];

Label[EnD];

]
]], 1];

Px = Compile[
{{x1d, _Complex}, {si1d, _Real}}
,
Module[{x1c = x1d, si1c = si1d}
, x1c +
1/2 (Floor[
Re[(-4 + si1c +
Sqrt[(-4 + si1c)^2 + 8 (-2 + si1c) (-1 + x1d)])/(
2 (-2 + si1c))]] +
Floor[Im[(-4 + si1c +
Sqrt[(-4 + si1c)^2 + 8 (-2 + si1c) (-1 + x1d)])/(
2 (-2 + si1c))]] I) (-4 +
si1c - (-2 +
si1c) (Floor[
Re[(-4 + si1c +
Sqrt[(-4 + si1c)^2 + 8 (-2 + si1c) (-1 + x1c)])/(
2 (-2 + si1c))]] +
Floor[Im[(-4 + si1c +
Sqrt[(-4 + si1c)^2 + 8 (-2 + si1c) (-1 + x1c)])/(
2 (-2 + si1c))]] I))]
, CompilationTarget -> "C", "RuntimeOptions" -> "Speed"];

PJ[x45_] := {
{
JacobiSymbol[x45, Floor[Re[Px[Total[BCC[x45, 5]], 11]]]] +
JacobiSymbol[x45, Floor[Re[Px[Total[BCC[x45, 11]], 5]]]],
JacobiSymbol[x45, Floor[Re[Px[Total[BCC[x45, 5]], 11]]]] -
JacobiSymbol[x45, Floor[Re[Px[Total[BCC[x45, 11]], 5]]]],
JacobiSymbol[x45, Floor[Re[Px[x45, 7]]]] +
JacobiSymbol[x45, Floor[Re[Px[x45, 5]]]],
JacobiSymbol[x45, Floor[Re[Px[x45, 7]]]] -
JacobiSymbol[x45, Floor[Re[Px[x45, 5]]]]
}, {
JacobiSymbol[x45 + 5, Floor[Re[Px[x45, 11]]]],
JacobiSymbol[x45 + 5, Floor[Re[Px[x45, 5]]]],
JacobiSymbol[x45 + 5, Floor[Re[Px[Total[BCC[x45 + 5, 5]], 5]]]],
JacobiSymbol[x45 + 5, Floor[Re[Px[Total[BCC[x45 + 5, 5]], 11]]]],
JacobiSymbol[x45 + 5, Floor[Re[Px[Total[BCC[x45 + 5, 11]], 5]]]]
}
};.
 

1. What is cryptography indexing?

Cryptography indexing is the process of creating a unique identifier for a piece of information using mathematical algorithms. This identifier, also known as a hash, can be used to verify the integrity of the information and protect it from being tampered with or accessed by unauthorized parties.

2. How does hash indexing work?

Hash indexing uses a mathematical function to convert a variable-length input into a fixed-length output. This output, or hash, is unique to the input and can be used as a digital fingerprint for the information. Any changes to the information will result in a different hash, making it easy to detect tampering.

3. What is primeality testing in cryptography?

Primeality testing is the process of determining whether a given number is a prime number or not. This is important in cryptography because prime numbers are used in many encryption algorithms. If a number turns out to be non-prime, it can compromise the security of the encrypted information.

4. How is primeality testing performed?

Primeality testing can be performed using various algorithms, such as the Lucas-Lehmer test or the Miller-Rabin test. These algorithms use mathematical properties of prime numbers to determine whether a given number is prime or not. In cryptography, these tests are often used to generate large prime numbers for encryption purposes.

5. Why is primeality testing important in cryptography?

Prime numbers are crucial in cryptography because they are used to create the keys and algorithms that protect sensitive information. If a non-prime number is mistakenly used in the encryption process, it can weaken the security and make it easier for hackers to access the information. Therefore, primeality testing is essential to ensure the security and integrity of encrypted data.

Similar threads

  • Precalculus Mathematics Homework Help
2
Replies
39
Views
4K
  • Introductory Physics Homework Help
2
Replies
38
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
15
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
3K
  • Calculus and Beyond Homework Help
Replies
2
Views
2K
Replies
8
Views
8K
  • Calculus and Beyond Homework Help
Replies
22
Views
18K
  • Introductory Physics Homework Help
Replies
4
Views
5K
  • Introductory Physics Homework Help
Replies
11
Views
3K
Back
Top