MathsWorld
All Exhibits

Keep the Key

The box contains two secret messages. One can be read straight away using either the red filter or the blue filter.
To read the other secret message you will need lock the box and send it through the tunnel. It may take more than one journey.
In cryptography, you lock your message by sending it in code. Can you think of two codes that could be used in this procedure?

Sending a secret message is like pu tting your message in a locked box. Your enemy could steal the box, but they don’t have a key to open it. Usually, you will need to send your friend a copy of the key, but this gives your enemy a chance to steal it. So, is there any other way to keep your key safe? One way to keep your key safe is to send the box multiple times. First, lock the box with your key and send it to your friend. Your friend doesn’t have your key, so decides to lock the box with their own key and send it back to you. Now the box is double-locked! Now that you have the box, you can remove your lock and send it back to your friend. Finally, your friend removes their lock and reads the message. Every time the box was sent it was either locked, or double-locked, without ever sending the keys, and is called the three-pass protocol. In cryptography, you lock your message by sending it in code, and your friend double-locks the message by applying their code. The two codes must be chosen so that you can apply and remove the codes in any order. For example, your code could be a Caesar shift and your friend’s code could be an anagram of the message.