(large primes are easy to find) n = pq ϕ(n) = ϕ(p)ϕ(q) = (p − 1)(q − 1) = n − (p + q − 1) (Euler’s totient) e such that 1 < e < ϕ(n) and gcd(e, ϕ(n)) = 1 Find d such that d ≡ e−1 (mod ϕ(n)) (discrete math, modulo arithmetic) Public key: n, e Private key n, d and everything else