Fermat's Little Theorem
The theorem states that for any prime p and any number aā{1,...pā1} we have that apā1ā”1Ā modĀ p.
RSA
RSA starts off with two primes, p and q.
We have N:=pq and a number e such that gcd(e,(pā1)(qā1))=1. Our private key is d:=eā1(mod(pā1)(qā1))
Encryption
E(x)=xemodĀ N Decrpytion
D(x)=ydmodĀ N