RSA
Asymmetric encryption
The idea
RSA is an asymmetric cipher: anyone can encrypt with your public key, but only you (holding the private key) can decrypt. Its security rests on the difficulty of factoring large numbers.
The cast
p,q— two primes (your secret)n = p·q— modulus (public)φ(n) = (p-1)(q-1)— Euler's totiente— public exponent (coprime to φ)d— private exponent (e⁻¹ mod φ)