Hail Caesar!
One of the simplest substitution ciphers is the Caesar Cipher, attributed to Julius Caesar by his biographer Suetonius. It's not a bad choice for military communications when fighting the illiterate. Otherwise, it isn't terribly secure. That said, a version of it has appeared more recently on the Web in the service of humor and diversion.
To use the Caesar Cipher, you write down your alphabet, and then choose a "shift" value to use for converting your plaintext message to cipher text. Julius Caesar used a shift of 3 (according to Suetonius), meaning that each letter in his original message would be replaced with the letter 3 positions farther down the line. So 'A' would be replaced with 'D', 'B' with 'E', etc. For the last three letters, X, Y, and Z, you wrap around to the beginning of the alphabet again, and use A, B, and C.
| |
To decode a message using a Caesar Cipher, it helps to know the shift used during the encoding, and then apply the enciphering process in reverse. In our example, for each letter in the scrambled message, you'd back up three positions on the alphabet to get the decrypted letter.
A mathematically equivalent form of decryption would be to shift forward again, using the complement of the original shift relative to the length of the alphabet.
In other words, if your alphabet is 26 characters long, and the original message was encrypted using a shift of 7, then encrypting the encoded text again using a shift value of 19 (= 26 - 7) will have the cumulative effect of encoding the original message with a shift of 26. This means replacing 'A' with 'A', so the compound forward shift would effectively un-encrypt the message.
Which brings us to the "ROT13" variant of the Caesar Cipher. ROT13 means a Caesar rotation or shift of the message by 13 places. Since 13 is its own complement of a 26 character alphabet, a plaintext enciphered with a shift of 13 can be effectively un-enciphered by a second application of the same shift.
On the Web, this sort of ultralight security has an immediately useful application hiding punch lines or spoilers. Nobody can immediately read the enciphered text, but the decoding method is an open secret, so with a ready link to a page like this, text can be quickly copied, pasted, and decoded.
Try it yourself! Who does Rick Blaine help to escape from Casablanca? Ivpgbe Ynfmyb naq Vyfn Yhaq.
Decrypting a Caesar Cipher, even when you don't know the Shift value, is a mechanical process. In this application, we simply try each shift from 1 to 25, and use the one that results in the largest number of real words when compared against a sizeable vocabulary list.

This 'Hail Caesar!' article by Mark Van Dine is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.
