RSA Public Key Encryption
RSA encryption works by creating a public modulus
N using two secret primes
p and
q,
and then choosing an encryption exponent
e such that gcd(
e, (p-1)(q-1)) = 1.
In order to encrypt a message, transform it into a number
m.
Then, use the public key
(N,e) to compute
c ≡
me (mod
N),
and send the ciphertext
c.
To decode the message, compute
d such that
ed = 1 (mod
(p-1)(q-1)).
Then compute
m' ≡
cd (mod
N).
The message
m' is the same as the original message
m.