Modulo

a

a ∈ Zc

b

c

Find a, b | a^b mod c = d

d

d = ab mod c

Find coprime

n

Click to select Zn

Coprime

All Coprime ∈ U(Zn)

E * D mod n = 1

E, D ∈ U(Zn)

Modular Multiplicative Inverse

Click to select Zp

Zp

p is prime

E

E ∈ U(Zp)

D

D = E-1 mod p

Big prime numbers

Modular Exponentiation in Zp

p

p ∈ N*

ϕ(n)

ϕ(n) = n.(1 - 1/p1).(1 - 1/p2)...

x

x ∈ Zp

E

E ∈ U(Zϕ(n))

D

D ∈ Zϕ(n)
m = xE  mod p
x = mD  mod p

RSA

p

p is prime

q

q is prime

n

n = p * q

ϕ(n)

ϕ(n) = lcm(p − 1, q − 1)

x

x ∈ Zp

E

E ∈ U(Zϕ(n))

D

D ∈ Zϕ(n)
m = xE  mod n
x = mD  mod n