Documente Academic
Documente Profesional
Documente Cultură
P and Q
N=P.Q
(N) = (P - 1)(Q - 1)
E (encryption key)
D (decryption key)
M (plaintext)
C (ciphertext)
:
:
:
:
:
:
:
private
public
private
public
private
private
public
There are two signs above, public and private. Public means
the value is unclassified. Everybody can get the information.
However, the private means it is confidential. We must save it
secretly. We hope nobody will find those value. The N value
is obtained from the multiplication P and Q. Euler function
is a function that is used in mathematical calculations on the
RSA algorithm. Euler function is a function that is used in
mathematical calculations on the RSA algorithm. Euler
function defines (N) for N 1 indicates the number of
positive integers < N relatively prime to N. Two numbers "A"
and "B" are relatively prime if GCD(A, B) = 1. The value of E
and D are used for both encryption and decryption
respectively. The M and C are the plaintext and ciphertext
byte arrays.
III. EVALUATION
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Value
5011
1093
5477023
5470920
GCD
2
3
4
5
6
7
8
9
10
1
12
13
14
15
8
1
18
1
20
21
2
1
24
5
26
9
28
1
30
. K + 1
(1)
= (. K + 1)
(2)
D
994712,82
1492069,2
1989425,5
2486781,9
2984138,3
3481494,6
3978851
4476207,4
4973563,7
5470920,1
5968276,5
6465632,8
6962989,2
7460345,5
7957701,9
8455058,3
Rest
9
2
6
10
3
7
0
4
8
1
5
9
2
6
10
3
18
19
20
21
22
23
24
25
26
27
28
29
30
8952414,6
9449771
9947127,4
10444484
10941840
11439196
11936553
12433909
12931266
13428622
13925978
14423335
14920691
7
0
4
8
1
5
9
2
6
10
3
7
0
= C.C
= 57 . 57
= 3249
= BD
= 3258 - 3249
= 9
Value
5011
1093
5477023
5470920
11
3978851
=
=
=
=
SQRT(N)
SQRT(5477023)
2340.304 (must be rounded down)
2340
= A+1
= 2340 + 1
= 2341
= A. AN
= 2341. 2341- 5477023
= 3258
=
= 3258
= 57
Cycle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
A
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
B
3258
7941
12626
17313
22002
26693
31386
36081
40778
45477
50178
54881
59586
64293
69002
73713
78426
83141
87858
92577
97298
102021
106746
111473
116202
120933
125666
130401
135138
139877
C
57
89
112
131
148
163
177
189
201
213
224
234
244
253
262
271
280
288
296
304
311
319
326
333
340
347
354
361
367
374
D
3249
7921
12544
17161
21904
26569
31329
35721
40401
45369
50176
54756
59536
64009
68644
73441
78400
82944
87616
92416
96721
101761
106276
110889
115600
120409
125316
130321
134689
139876
R
9
20
82
152
98
124
57
360
377
108
2
125
50
284
358
272
26
197
242
161
577
260
470
584
602
524
350
80
449
1
A
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
B
3661506
3667553
3673602
3679653
3685706
3691761
3697818
3703877
3709938
3716001
3722066
3728133
3734202
3740273
3746346
3752421
3758498
3764577
3770658
3776741
3782826
3788913
3795002
3801093
3807186
3813281
3819378
3825477
3831578
3837681
C
1913
1915
1916
1918
1919
1921
1922
1924
1926
1927
1929
1930
1932
1933
1935
1937
1938
1940
1941
1943
1944
1946
1948
1949
1951
1952
1954
1955
1957
1959
D
3659569
3667225
3671056
3678724
3682561
3690241
3694084
3701776
3709476
3713329
3721041
3724900
3732624
3736489
3744225
3751969
3755844
3763600
3767481
3775249
3779136
3786916
3794704
3798601
3806401
3810304
3818116
3822025
3829849
3837681
R
1937
328
2546
929
3145
1520
3734
2101
462
2672
1025
3233
1578
3784
2121
452
2654
977
3177
1492
3690
1997
298
2492
785
2977
1262
3452
1729
0
=
=
=
=
3052 3837681
3052 1959
1093
=
=
=
=
+
3052 + 3837681
3052 + 1959
5011