Return to my Puzzle pages
Go to my home page
© Copyright 2002, Jim Loy
This is one version of a famous story:
Pretend that you cannot trust the government; you see that this is fiction. And you must sent a box, with something valuable inside, to a friend in a distant city. You expect the people at the post office to open the box and steal the contents, unless you lock the box, which can accept one or more locks. Luckily, padlocks with keys are common. If you lock the box with your padlock, the people at the post office will certainly look for easier pickings elsewhere. But if you use a padlock, you will have to send the key to your friend, and the key will be stolen en route. Even a letter with a photograph of the key will be stolen. Even if you can fax a picture of the key, the people at the phone company will also receive your fax and send it on the the post office. In other words, you cannot send a copy of the key to your friend. How can you send the box, so that only your friend can open it?
Think about that before reading on.
Answer: The simplest solution is to lock the box with your own padlock and send it to your friend. Then your friend will lock it with a second padlock and return the box to you. You remove your padlock and send the box back to your friend, who then removes his/her padlock and opens the box.
This has a direct application in cryptography. Let's say that you want to send a secret message to your friend. You don't trust commercial and freeware encryption methods, so you use a secret cipher of your own. To make your cipher extra secure, you are the only person in the world who knows the secret cipher. Not even your friend knows it. So you send the encrypted message; your friend encrypts it further with his/her favorite secret cipher and sends it back to you; you remove your cipher and send it back to your friend; and he/she removes the second secret cipher and reads the message. This is very quick and easy, by email. You just have to choose secret ciphers that don't interfere with each other.
Most ciphers are shifts of the letters, modulo 26 (See Modular Arithmetic) or something similar. The amount of the shift is based upon a key, and perhaps other things. If the shift is based upon previous letters in the message, then the encryption method may be fairly fragile, typos and errors in transmission may scramble the rest of the message. And employing a second encryption method may scramble the message, too. But, if the method (which can be simple or very complicated indeed) just involves the key and modular arithmetic, then a second encryption by a similar method (or the same method with a different key) will not scramble the results beyond recovery. The first encryption method can then be removed by the sender, and the message remains encrypted by the second method only, and the receiver can then decrypt it.
The above story of the locked box is often told as an intro to public key cryptography. The ideas are perhaps related in some ways. But the story may just be told to show that really secure ciphers (ones where the decryption keys are not spread around to many people) are possible.