Public key / private key cryptography can be a difficult system to understand. Here is a plain language description. Throughout this explanation we will be talking about three people:

  • Bob - Sue's friend
  • Sue - Bob's friend
  • Eve - Nobody's friend

Bob and Sue want to have a discussion over email but are worried that Eve might intercept their communications, so they decide they need to use cryptography. Bob and Sue create their own public keys and private keys. For a good image think of the public key as an open lock and the private key as the key to the lock.

Bob and Sue then send their public keys to a public key server. Again for an image think of a locker with with a person's name on it, say Sue. When you open the locker (which is always open) you see a rack full with multiple replicas of the above mentioned open lock.

So Bob wants to send a secure message to Sue. He writes his message, gets Sue's public key, encrypts the message, then sends it to Sue. Again with an image - think of Bob writing out a letter by hand. He then goes to Sue's locker and grabs one of those open locks. He puts his letter into a special envelope so that once he attaches the lock it can't be opened by anyone or anything without the key for the lock. He then puts it in a mailbox - sending it on its way.

Now in comes Eve. She really wants to know what is going on between Bob and Sue, so she hacks into a mailserver somewhere on the route between Bob and Sue. She sees the message come in and grabs a copy. For an image just think that Eve happens to moonlight for the Post Office. She sees the letter come in and grabs it.

If Bob had not used any encryption Eve would be able to just read the mail, but Bob did. No matter what eve does she cannot read the mail. As such she just sends it on its way.

Sue gets the email message she has been waiting for. She decrypts the message and reads it - she takes out her key and unlocks the lock that kept the envelope sealed.

Source - Simon Singh's The Code Book