Public-key cryptography. Used to encrypt messages sent between two communicating parties so that an eavesdropper who overhears the conversation cannot decode them. Also enables a party to append an unforgeable signature to the end of a message. This signature cannot be "easily" forged and can be checked by anyone. Suppose Alice and Bob are communicating. And Bob wants to send a message to Alice. Alice has two keys, a secret key S_A that only Alice knows and a public key P_A that Alice advertises to the whole world. Both the keys are actually functions that map a message to another message. Bob: M -> P_A(M) -------------> Alice: S_A(P_A(M)) -> M So we want two functions S_A and P_A such that S_A(P_A(M)) = M, for all permissible messages M. Furthermore, any eavesdropper, who can read message P_A(M), cannot extract M from this -- or, in fact, cannot extract any reasonable information from this. RSA cryptosystem: 1. Alice selects at random two large primes p and q. 2. Compute n = pq. 3. Select a small odd integer e that is relatively prime to (p-1)(q-1). 4. Set d so that d*e is 1 modulo (p-1)(q-1). 5. Publish the pair (e,n) as the public key. 6. Keep secret the pair (d,n) as the secret key. In order to send message M, Bob sends P_A(M) = M^e (mod n) Alice computes S_A(M') = M'^d (mod n) = M^{de} (mod n) = M. Example: Take p = 5, q = 3, n = 15. (p-1)(q-1) = 8. Set e = 3. Set d = 3.