RSA encryption scheme
Algorithm
- Construction Phase:
- Select two random large primes p, and q.
- Calculate N = pq and ϕ(N) = (p−1)(q−1).
- Pick an encryption key e that is coprime with ϕ(N).
- Calculate the decryption key d such that de ≡ 1 (mod ϕ(N)).
- Operation Phase:
- Make the public key (N,e) public, and keep p, q and d as secrets.
- Sender encrypts its message M as E(M) = Me (mod N).
- Receiver decrypts it by calculating E(M)d = Med ≡ M (mod N).