8.8. The RSA Algorithm 215
The RSA Cryptosystem
Beforehand The receiver creates a public key and a secret key as follows.
- Generate two distinct primes,pandq. Since they can be used to
generate the secret key, they must be kept hidden. - LetnDpq.
- Select an integeresuch that gcd.e;.p 1/.q 1//D 1.
Thepublic keyis the pair.e;n/. This should be distributed widely. - Computedsuch thatde1 .mod.p 1/.q 1//. This can be done
using the Pulverizer.
Thesecret keyis the pair.d;n/. This should be kept hidden!
Encoding Given a messagem, the sender first checks that gcd.m;n/D 1.
The sender then encrypts messagemto producemusing the public key:
mDrem.me;n/:
DecodingThe receiver decrypts messagemback to messagemusing the secret
key:
mDrem..m/d;n/: