public key cryptography (RSA) Public key - available to everyone. K+ Private key - secret K- Message: a Encrypt: K+(a) Decrypt: K-(K+(a)) = a Can't use K+ to decrypt the message. Public Key: n=11 and r=15 Private Key: m=3 Encode: a = 7 Calculate: a^n mod r 7^11 mod 15 = 13 Decode: c = 13 Calculate: c^m mod r 13^3 mod 15 = 7 Find the private key! r = p * q (where p and q are prime) for r = 15 so p=5, q=3 (for big numbers, this takes a long time!) m*n = k*(p-1)*(q-1) + 1 m*n = k*4*2 + 1 = 8k + 1 m = (8k + 1)/11 (m must be an integer) k (8k+1)/11 1 9/11 2 17/11 3 25/11 4 33/11 = 3 (private key) Session keys Use RSA to exchange a secret key Use the secret key to send messages. Rebuild secret key Signatures sign a document with my private key you decode with my public key RSA Homework (Due Friday 5/3) public key n=47, r=989 - decode one group of 3 digits at a time. - Use the RSA calculator - Show steps for underlined number - Don't put leading zero in RSA calculator - If you get a 2 digit number out, put a zero on the left to make it three digits - Take numbers in pairs and turn them to characters. e.g. 727 172 -> 72 71 72 -> H G H