Cryptography/RSA

Fermat's Little Theorem

The theorem states that for any prime p and any number a∈{1,...pāˆ’1}a \in \{1, ... p-1\} we have that apāˆ’1≔1Ā modĀ p.a^{p - 1} \equiv 1 \text{ mod }p.

RSA

RSA starts off with two primes, pp and q.q.

We have N:=pqN:= pq and a number ee such that gcd(e,(pāˆ’1)(qāˆ’1))=1.\text{gcd}(e, (p - 1)(q-1)) = 1. Our private key is d:=eāˆ’1(mod(pāˆ’1)(qāˆ’1))d:= e^{-1}(\text{mod} (p - 1)(q - 1))

Encryption

E(x)=xemodĀ NE(x) = x^e \text{mod } N

Decrpytion

D(x)=ydmodĀ ND(x) = y^d \text{mod } N

Last updated

Was this helpful?