Public Key Encryption #### Introduction If you are at all interested in security, you must read _The Code Book_ by Simon Singh. One of the finest books I've ever read. I will paraphrase his thoughts on public key encryption here. _code_: "Jupiter" implies "Attack at dawn" (Use Noel Becar's father example) _cypher_: replaces letters not words. "xyz" computed/encrypted from "cat" via simple substitution cypher c->x, a->y, t->z. DES: Data Encryption Standard (1976). Converts plain text into cyphertext using a key. Bigger the key, harder it is to crack. 56bit DES. #### Key distribution problem The problem is how do you get the key to someone so they can decrypt the message you are sending. In the old days, they used codebooks that would specify the key rotation for which day etc... The problem is that those can be captured as in WWII submarine we nabbed. With computers: You can't call on the phone to tell someone the code, but it's better than emailing it in the clear. In person is best, but can still be overheard. Banks used to send couriers around with the keys in a locked briefcase! The development in the 1970's of a key distribution mechanism is a triumph! ### Key exchange The new strategy: "Alice wants to send an intensely personal message to Bob. Again, she puts her secret message in an iron box, padlocks it and sends it to Bob. when the box arrives, Bob adds his own padlock and sends the box back to Alice. When Alice receives the box, it is now secured by two padlocks. She removes her own padlock, leaving just Bob's padlock to secure the box. Finally she sends the box back to Bob. And here is the crucial difference: Bob can now open the box because it is secured only with his own padlock, to which he alone has the key." The problem is in the order of encryption operations for a computer. You must encrypt/decrypt by "last on, first off." This order problem breaks. Alice encrypts then Bob encrypts, but Alice cannot undo his encryption so she can decrypt hers. Even though this doesn't work for computers, it inspired Diffie and Hellman! They started looking at trap-door math (non-two-way functions like on then off of a lightbulb). One-way: mixing blue and yellow paint to get green cannot be undone by "unmixing". Given {3^x = 1} in modular arithmetic 7, what is {x}? Only way is to try all combinations of x looking for a solution. If you make 3 bigger, you really have lots to try out. That is why bigger "keys" are stronger. Bob and Alice agree to use {y^x} mod p and choose say {7^x mode 11}. Initially Alice and Bob agree on values for y and p. Almost any values are cool, but y