Applied aspects of number theory
Author
Olga Opalikhina
Title
Applied aspects of number theory
Description
The program code deals with the applied aspects of number theory related to the algorithm of exponentiation modulo. This algorithm is used in the RSA cryptosystem. A method of increasing the level of protection of the asymmetric RSA algorithm is proposed, based on the generation of pseudorandom primes with a large module. This generation excludes decomposition into continuous fractions when trying to find the RSA private key. Modeling of the asymmetric cryptosystem is done in the Wolfram Mathematica computer environment. In the simulation process, a reversible one-dimensional cellular automaton is used, implementing rule 15. The work of the cellular automaton is based on the logical operation of the sum modulo two. To assess the vulnerability of the cryptosystem, an attack by Michael Wiener is embedded in the program code.
Category
Working Material
Keywords
pseudorandom primes, exponentiation modulo, elements of the ring of deduction classes, open exponent, closed exponent, public key, private key, continuous fraction, convergents, reversible one-dimensional cellular automaton, sum modulo two
URL
http://www.notebookarchive.org/2021-11-1w6m71o/
DOI
https://notebookarchive.org/2021-11-1w6m71o
Date Added
2021-11-04
Date Last Modified
2021-11-04
File Size
29.53 kilobytes
Supplements
Rights
CC BY 4.0
Download
Open in Wolfram Cloud
Applied aspects of number theory
Applied aspects of number theory
Olga Opalikhina
In[]:=
p=RandomPrime[100000000];q=RandomPrime[100000000];n=%*%%;nn=(%%-1)*(%%%-1);g=RandomPrime[{3,nn-1}];d=PowerMod[g,-1,nn];font="Country";ToCharacterCode@font;PowerMod[ToCharacterCode@font,g,n];PowerMod[%,d,n];FromCharacterCode@%m=GeoIdentify["Country"];key=GenerateAsymmetricKeyPair[];Encrypt[key["PublicKey"],m];Decrypt[key["PrivateKey"],%]FindGeoLocation[]Convergents//AbsoluteTimingn1=9449868410449;g1=6792605526025;d1=569;Convergents//AbsoluteTimingBinaryDistance[d,d1]m1=ArrayPlot[CellularAutomaton[15,{{1},0},100],ColorRules{1Red,0Blue},ImageSize200]m2=#&With[{u=Boole@PrimeQ[{p,q,g}]},ArrayPlot[Product[(1)^i*CellularAutomaton[15,ReplacePart[u,3->i],3],{i,0,1}],ColorRules->{1Red,0Blue},FrameTicks{All,All,All,All},ImageSize200]]Animate[ArrayPlot[CellularAutomaton[a,{{1},0},100],ColorRules{1Red,0Blue},ImageSize200],{a,List[15,30,85,240]}]Animate[m2,{m2,List[m2,m1]}]
g
n
g1
n1
Out[]=
Country
Out[]=
South Africa
Out[]=
GeoPosition[{-26.38,27.84}]
Out[]=
0.0001727,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,
1
4
3
13
7
30
31
133
193
828
417
1789
610
2617
2857
12257
3467
14874
9791
42005
81795
350914
664151
2849317
2074248
8898865
2738399
11748182
10289445
44143411
13027844
55891593
23317289
100035004
82979711
355996605
1682911509
7219967104
8497537256
36455832125
18677986021
80131631354
27175523277
116587463479
263257695514
1129418802665
290433218791
1246006266144
1424990570678
6113443867241
1715423789469
7359450133385
18579228465368
79707945201091
150349251512413
645023011742113
Out[]=
0.0001418,0,1,,,,,,,,,,,,,,,,,,,,,,,,,,
2
3
3
4
5
7
18
25
23
32
409
569
1659
2308
2068
2877
3727
5185
76608
106577
156943
218339
1175209
1634950
8383406
11662989
34708833
48286906
77801072
108236801
112509905
156523707
190310977
264760508
302820882
421284215
10486220965
14588423818
31761483777
44186555669
42247704742
58774979487
369743121713
514386391565
411990826455
573161371052
1193724774623
1660709133669
2799440375701
3894579638390
6792605526025
9449868410449
Out[]=
1
Out[]=
Out[]=
#1&
Out[]=
| ||
Out[]=
| ||
#1& |
Cite this as: Olga Opalikhina, "Applied aspects of number theory" from the Notebook Archive (2021), https://notebookarchive.org/2021-11-1w6m71o
Download