Skip to main content

Verified by Psychology Today

Cryptograms and the Allure of Secret Codes

Everyone loves a concealed message!

We seem to have an instinctive fascination for mysteries and, especially, for mysteries that revolve around secret codes. This penchant brought about a publishing sensation in 2003-Dan Brown's novel The Da Vinci Code. In my view, the book became a runaway bestseller in large part because it played ingeniously on this fascination. The novel revolves, in fact, around a secret code, which Brown calls the "Da Vinci Code." The protagonist, Harvard professor Robert Langdon, is the one who deciphers it by interpreting individual clues scattered throughout the novel.

Secret codes have a long history behind them. The ancient Jewish religious writers, for instance, concealed messages by substituting one letter of the Hebrew alphabet with another-the last letter in place of the first, the second last for the second, and so on.

They called their code atbash.

Cryptography is the technical name given to the craft of concealing messages with codes. It has been used throughout history for various purposes, especially military ones. For example, in the fifth century BCE, Spartan soldiers communicated with their field generals during battle by concealing a message across a strip of parchment wrapped spirally around a staff called a scytale. In 1917, during World War I, British naval intelligence intercepted and deciphered a cable telegram written in code by the German foreign secretary Arthur Zimmermann. The message outlined plans for unrestricted submarine warfare. The decoded information caused President Woodrow Wilson and the Congress to declare war on Germany. During World War II, British Intelligence hired thousands of people to break codes, including the renowned mathematician Alan Turing, a pioneer in computer theory. Because of security restrictions, Turing's role as a military cryptographer was not known until long after his death.

The English medieval friar Roger Bacon was among the first to write systematically about cryptography in his Secret Works of Art and the Nobility of Magic (13th century). But the first known comprehensive treatise on cryptography was written by a German abbot named Johannes Trithemius in 1510. Today, banks, corporations, governments, and other institutions have become dependent on this science for security reasons, since they routinely send confidential information from one computer to another.

Given the extraordinary ingenuity that has gone into inventing and breaking secret military and other codes over the centuries, it is little wonder that cryptography has given rise to a genre of puzzles called, appropriately enough, cryptograms. These became very popular in the nineteenth century, as witnessed by the fact that Edgar Allan Poe used a cryptogram in his story The Gold Bug (1843), making the plot revolve around it. Poe used a random-substitution letter-to-symbol cipher, with numbers and punctuation marks, and without word divisions, supposedly devised by the pirate Captain Kidd. The narrative uses of cryptograms spread quickly shortly thereafter, becoming the basis of many mystery stories, such as Jules Verne's La Jangada (1881) and Maurice Leblanc's The Hollow Needle (1910). In his Sherlock Holmes mysteries, Sir Arthur Conan Doyle sometimes included ciphers for the master detective to unravel. The 1930s fictional crime fighter, The Shadow, devised special symbols to make ciphers. Such writers obviously knew that the intricate process of decoding a cipher adds immeasurably to the suspense.

The most common type of cryptogram puzzle is the letter-to-letter substitution, known as a Caesar cipher, because it was Julius Caesar who apparently used it as a technique. Of course, atbash (mentioned above) also falls under this rubric. Here's how the puzzle works. What three-word simple phrase does the following encode?


The hidden phrase, called technically the plaintext, is "I LOVE YOU." It was encoded by replacing each letter with the letter coming before it in the normal alphabetic sequence. So, "I" was replaced with "H" (the letter just before it), "L" with "K," "O" with "N," and so on. That is the code. The cryptogram constructed with the code is called the ciphertext.
Here are three Caesar ciphers for you to decode. If you get stuck, start by trying to figure out what grammatical words have a high frequency in the structure of a sentence (a, the, in, etc.), and which sequences or clusters of vowels and consonants are possible or impossible. Also, note that the alphabet sequence continues after "Z." For example, if you discover that the letter replacing "Y" is the third one after it in the alphabetic sequence, then the letter replacing, say, "Y" is "B." This is so because the first letter after "Y" is "Z", the second one is "A" (starting over), and the third one is, of course, "B."

(1)This cryptogram hides something written by the Anglo-Irish playwright Oscar Wilde in 1894 in the Oxford student magazine The Chameleon:

(2)This next one encodes something written by American author Maya Angelou in her book, Take Nothing for My Journey Now (1993):

(3)This last Caesar cipher conceals something written by Mark Twain in his short novel The Refuge of the Derelicts (1905):

The fun and the challenge (or perhaps frustration) come from figuring out the secret code by thinking logically and linguistically. Incidentally, the American president Thomas Jefferson was fascinated by this kind of cryptography. He built an ingenious device for making Caesar ciphers, consisting of wooden wheels, each representing the letters of the alphabet printed in different arrangements. He called it the Wheel Cipher. His gadget made it easy to produce a ciphertext automatically by lining the plaintext up against the wheels.

Another popular type of cryptogram puzzle is the number-to-letter cipher, known as a Polybius cipher, because its invention is attributed to the Greek historian Polybius (c. 200-c. 118 BCE). One simple Polybius code would be to replace each letter of the plaintext with digits in numerical order. For example, if the plaintext is "I LIKE LIFE," the code would replace "I" with "1," being the first letter in the text, "L" with "2," being the second letter in the text, and so on. The end result is the following ciphertext. Note that the same number is used for the same letter, no matter where it appears.

1 * 2 1 3 4 * 2 1 5 4

Here are three Polybius cryptograms for you to solve. Again, to figure out the secret code, start by considering which words are more likely to occur in certain positions, and which letter sequences and clusters are possible or impossible. Note that each number is underlined so that it can be read correctly. Thus 2 stands for the number "two," and 23 for the number "twenty-three," not the sequence "two" and "three:"

(4)This cipher encodes something that Australian feminist wrote in her book The Female Eunuch (1970). Here are two clues to help you get started: the number 23 replaces the letter "W" of the plaintext and the number 5 replaces the "E". Do you see any pattern? (I'm putting a * in between words)
23 15 13 5 14 * 8 1 22 5 * 1 12 23 1 25 19 *2 5 5 1 4 9 14 *

3 12 15 19 5 18 * 3 15 14 20 1 3 20 * 23 9 20 8 * 18 5 1 12 9 20 *

25 * 20 8 1 14 * 13 5 14.

(5)This next one hides a quotation by the late President John F. Kennedy, which he uttered during a speech he delivered on October 26, 1963 at Amherst College in Massachusetts. This time you are not given any clues:

9 14 * 6 18 5 5 * 19 15 3 9 5 20 25 * 1 18 20 * 9 19 * 14 15 20 *

1 * 23 5 1 16 15 14.

(6)For your last Polybius cipher, try the following one, which encodes something written by American author Erica Jong in her book Fear of Flying (1973). Here is one clue. It is an important one: "A" has been replaced with "26":

20 12 8 8 18 11 * 18 8 * 7 19 22 * 2 11 18 26 7 22 * 12 21 *

7 19 22 * 12 11 11 9 22 8 8 22 23.

The above cryptograms are known generically as substitution ciphers, because they involve some form of substitution. Another widely-used method of enciphering messages is transposition. This involves reordering or rearranging the letters in some way: for example, by writing words backward (SARA LOVES MARK = ARAS SEVOL KRAM); by separating the vowels from the consonants (SRAA LVSOE MRKA); and so on. There are many other ways to create transposition puzzles, but for your last two puzzles only two simple transposition codes will be used. Here's a clue. Both puzzles deal metaphorically with "RAIN:"



Cryptograms have a unique appeal. They present us with a mystery-What does it mean? The meaning can be easily gleaned by unlocking the "secret code" with which such puzzles are created. The solution imparts a feeling of great satisfaction, akin to that of solving a real mystery. In some ways, cryptograms are small-scale models of how we envision the mysteries of Nature. Scientists are confronted with large-scale mysteries, such as the meaning of the DNA. They go about solving them by trying to decode the language with which Nature wrote them, translating them into human language in the hope, ultimately, of understanding the "Master Code" with which all of life is written.


(1)AMBITION IS THE LAST REFUGE OF THE FAILURE. Each letter in the plaintext has been replaced with the one after it in the alphabet sequence: "A" has been replaced by "B," "M" by "N," "B" by "C," and so on.

(2)PEOPLE WILL NEVER FORGET HOW YOU MADE THEM FEEL. Each letter has been replaced with the second one after it in the alphabet sequence: "P" in the plaintext has been replaced by "R," "E" by "G," "O" by "Q," and so on.

(3)THERE WAS NEVER yet an Uninteresting life. Each letter has been replaced with the second one before it in the alphabet sequence: "T" has been replaced by "R," "H' by "F," "E" by "C," and so on.

(4)WOMEN HAVE ALWAYS BEEN IN CLOSER CONTACT WITH REALITY THAN MEN. Each letter has been replaced with a number indicating its numerical position in the alphabet sequence: "W" has been replaced by "23" (since it is the 23rd letter in the alphabet), "O" by "15," "M" by "13," and so on. The complete code (including letters not used in the plaintext) is as follows: A = 1, B = 2, C = 3, D = 4, E = 5, F = 6, G = 7, H = 8, I = 9, J = 10, K = 11, L = 12, M = 13, N = 14, O = 15, P = 16, Q = 17, R = 18, S = 19, T = 20, U = 21, V = 22, W = 23, X = 24, Y = 25, Z = 26

(5)IN FREE SOCIETY ART IS NOT A WEAPON. The code used is the same as the one used for the previous puzzle. Did you miss it? Each letter has been replaced with a number indicating its numerical position in the alphabet sequence: "I" has been replaced by "9" (since it is the 9th letter in the alphabet), "N" by "14," "F" by "6," and so on.

(6)Gossip is the opiate of the oppressed. The code used for this one is a hard one to crack. Each letter has been replaced by the digits in reverse (backward) order. For example, in the usual order "Z" would be replaced by "26," since it is the 26th letter of the alphabet; but with this reverse code it is replaced by "1"; "B" would be replaced by "2" in the usual order; now it is replaced by "24", and so on. The complete code (including letters not used in the plaintext) is as follows: A = 26, B = 25, C = 24, D = 23, E = 22, F = 21, G = 20, H = 19, I = 18, J = 17, K = 16, L = 15, M = 14, N = 13, O = 12, P = 11, Q = 10, R = 9, S = 8, T = 7, U = 6, V = 5, W = 4. X = 3, Y = 2, Z = 1.

(7)WHEN IT RAINS IT POURS. The words of the plaintext are written backwards.

(8)IT RAINED ON THEIR PARADE. The words of the plaintext are written together without the usual space between them.