Modulo
Find Coprime
Modular Multiplicative Inverse
Big prime numbers
Modular Exponentiation
RSA
Source Code
Modulo
a
a ∈ Z
c
b
c
Find A
Find B
Find a, b | a^b mod c = d
d
d = a
b
mod c
a
b
mod c
Find coprime
n
Click to select Z
n
17
37
131
557
751
1123
2731
4987
12697
90031
Coprime
All Coprime ∈ U(Z
n
)
Find Coprime
E * D mod n = 1
E, D ∈ U(Z
n
)
Find E, D
Modular Multiplicative Inverse
Click to select Z
p
449
719
1789
2293
9539
3779
33577
43597
74051
23857
125207
9999593
Z
p
p is prime
E
E ∈ U(Z
p
)
Find coprime E ∈ U(Z
p
)
D
D = E
-1
mod p
Find D
Big prime numbers
Click to copy/select
p
449
719
659
557
1789
2293
6719
8933
124673
215737
5685829
9997927
324617
125507
2585641
4244621
32437247
32438083
52436971
72437347
29436599
134364829
234364421
524364251
Modular Exponentiation in Z
p
p
p ∈ N
*
ϕ(n)
ϕ(n) = n.(1 - 1/p
1
).(1 - 1/p
2
)...
x
x ∈ Z
p
Random
E
E ∈ U(Z
ϕ(n)
)
Find coprime
D
D ∈ Z
ϕ(n)
Brute Force Inverse
Fast Inverse
Encryption
m = x
E
mod p
Decryption
x = m
D
mod p
RSA
p
p is prime
17
859
619
1249
2663
3593
5641
53093
41077
75539
613471
999491
q
q is prime
433
1039
1847
4421
5419
6053
75253
39359
692581
126199
431147
990809
n
n = p * q
ϕ(n)
ϕ(n) = lcm(p − 1, q − 1)
x
x ∈ Z
p
Random
E
E ∈ U(Z
ϕ(n)
)
Find coprime
D
D ∈ Z
ϕ(n)
Brute Force Inverse
E
ϕ(n)-2
mod ϕ(n)
RSA Encryption
m = x
E
mod n
RSA Decryption
x = m
D
mod n