Lesson №12 1586 to today 24 min
Famous ciphers
A cipher that sent a queen to the scaffold. A telegram that pulled America into a war. A killer who taunted the police in code. A sculpture in the CIA's courtyard. A treasure that may never have existed. Five case files from the Black Chamber.
In this lesson
- what a nomenclator is and how Thomas Phelippes broke one
- why the British hid the fact that they had read the Zimmermann telegram
- how a book cipher works and why the Beale ciphers look like a hoax
- how the Zodiac 340 was read after 51 years, and what we know about Kryptos
The morning of 8 February 1587, Fotheringhay Castle. Mary, Queen of Scots, nineteen years a prisoner in England, climbs the scaffold. She was condemned by her own letters. They were in cipher, and Mary was sure no one could read them. They were read by a man she had very likely never heard of.
This is the last lesson of the course, and it brings no new cipher. It brings stories: five cases that show everything we have covered, from substitution and letter counts to codes, book keys and transpositions. Some of these ciphers fell within a week, some held out for decades, and one is still unread.
Mary, Queen of Scots, and the Babington plot
In 1586 Mary was held under close guard at Chartley. She was allowed no letters. So she was delighted when a secret channel appeared: letters travelled in a waterproof case inside the stopper of a beer barrel delivered to the house. Mary did not know that the channel had been set up by Sir Francis Walsingham, Queen Elizabeth's spymaster. Every letter was opened on the way, copied and sealed again.
A young gentleman, Anthony Babington, and his friends planned to free Mary, kill Elizabeth and put Mary on the English throne. In July 1586 he laid the plan out in a letter to Mary. One thing was missing: her consent. Without it there was nothing to charge her with.
What a nomenclator is
Mary and Babington wrote in a nomenclator, a mix of cipher and code. Each letter has a symbol: a plain substitution, as in the lesson on frequency analysis. But the table also has symbols for whole words, such as “and”, “the”, “queen”. It has nulls, symbols that mean nothing and are thrown in to spoil any count. And it has a sign for “repeat the last letter”. Mary's had 23 symbols for letters, four nulls, a doubling sign and 36 symbols for common words.
One line from the end of a letter, in the same nomenclator as above. You have the key. What does the writer want?
Click a symbol and it lights up in the key. Skip the nulls (∅).
The first two “words” are one symbol each, from the Words section. The third is spelled out letter by letter and starts with N.
The first symbol is the word “send”, the second “the”, then the letters n, a, m, e, s (with a null in the middle). The line says “send the names”: the writer wants the names.
Keep this line in mind. In 1586 it was not written by Mary at all, as you are about to see.
The letters from the barrel went to Thomas Phelippes, Walsingham's best codebreaker. He knew languages and he knew frequency analysis, the method from lesson two: the commonest symbols stand for the commonest letters of the language. Nulls and code words got in the way, but there were many letters. Phelippes rebuilt the whole table.
On 17 July 1586 Mary replied to Babington and approved the plan. That was enough to condemn her. But Walsingham wanted every conspirator's name. So Phelippes did something possible only once a cipher is completely broken: he added a postscript to Mary's letter in her own cipher, asking Babington for the names of the six gentlemen who would carry out the deed. Nobody noticed the forgery. The plotters were arrested, and Mary was tried and executed.
A weak cipher is worse than none. Without a cipher Mary would have written carefully. Trusting her table, she wrote everything plainly, and gave her enemy not only evidence but the power to write in her name.
The Zimmermann telegram
January 1917, the third year of the First World War. Germany is about to start unrestricted submarine warfare, sinking any ship, neutral ones included, which is almost certain to bring the United States into the war. The German foreign secretary, Arthur Zimmermann, has an idea: offer Mexico an alliance. If America joins the war, Mexico will attack it and win back Texas, New Mexico and Arizona.
On 16 January 1917 the telegram went to the German ambassador in Washington, to be passed on to Mexico City. It was in diplomatic code 0075. A code differs from a cipher: it replaces not letters but whole words and syllables with numbers from a thick codebook. “Mexico” is one number, “alliance” another.
Germany had no transatlantic cable of its own: the British had cut it in the first days of the war. Its telegrams went over other lines, and British intelligence intercepted them. In the section known as Room 40, the codebreakers Nigel de Grey and William Montgomery took the telegram on. Codebook 0075 had been partly rebuilt from earlier intercepts, and the meaning came through.
Then came the real problem. Hand the text to the Americans and the Germans would realise their codes were being read, and change them. The British found a way out: they obtained the copy that the ambassador had sent on to Mexico City, in an older code. Now they could pretend the text had been picked up in Mexico rather than broken in London. In late February the telegram was given to the Americans, and on 1 March the newspapers printed it. Many called it a fake, until on 3 March Zimmermann himself admitted it was genuine. On 6 April 1917 the United States declared war on Germany.
Why did the British go to such lengths to pretend they had got the telegram in Mexico?
A break is worth most while the enemy doesn't know about it. Revealing one secret at the cost of all future ones is a bad trade. The British kept to the same logic with Enigma in the Second World War.
The Beale ciphers: a treasure that wasn't
In 1885 a pamphlet appeared in Lynchburg, Virginia. It told how around 1820 a certain Thomas Beale had buried a treasure of gold, silver and jewels in Bedford County. Beale left a locked box with an innkeeper, containing three sheets of numbers, and vanished. The first sheet, said the pamphlet, gave the location, the second the contents, the third the names of the heirs.
The pamphlet's author claimed to have read the second sheet. It is a book cipher: the key is a text both parties own. Its words are numbered, and each number stands for the first letter of that word. The key to the second sheet turned out to be the Declaration of Independence, and the numbers became an account of how much gold and silver lay buried in Bedford County.
A good book cipher is very strong: as long as the enemy doesn't know the book, the numbers mean nothing. And one letter has dozens of numbers, so frequencies don't help. The weakness lies elsewhere: guess the book, and everything reads at once.
A treasure hunter left a note, and a copy of the Declaration of Independence lay open beside it. What is buried?
4, 6, 33, 62, 26
It is a book cipher. The numbers point to words of the Declaration's first sentence, counting “When” as 1. Take each word's first letter.
Type the numbers into the widget above and it will count the words for you. Word 4 is “Course”, so C.
4 is Course, 6 human, 33 earth, 62 should, 26 to. First letters: C-H-E-S-T. The answer is chest.
The sentence has many words starting with T, S and E, so a sender can spread the same letter over many numbers. An interceptor who doesn't know the book sees five unrelated numbers and has nothing to count.
Beale's first and third sheets are still unread, neither with the Declaration nor with any other known text. And a great deal suggests there is nothing to read. No record of a Thomas Beale has ever been found. The language of “Beale's letters” in the pamphlet is suspiciously like the pamphlet author's own. And in 1980 the cryptographer Jim Gillogly noticed something odd: decode the first sheet with the same Declaration and you get nonsense, but nonsense with long runs of the alphabet in order: ABFDEFGHIIJKLMMNOHPP. That doesn't happen by chance. It looks as if whoever made up the numbers ran a finger along the Declaration in order. Most researchers think the Beale ciphers are a hoax, though treasure hunters still dig in Bedford County.
The Zodiac: 408 and 340
In the late 1960s a serial killer calling himself the Zodiac was at large in the San Francisco Bay Area. He wrote to newspapers and taunted the police with ciphers. At the end of July 1969 three papers each received a third of a 408-symbol cipher. Within about a week it was read, not by the police but by Donald and Bettye Harden, a schoolteacher couple from Salinas who saw it in the paper.
It was a homophonic substitution: common letters had several different symbols each, to flatten the frequencies, the same idea as in Beale's book cipher. The Hardens started from a guess, a crib, just as at Bletchley Park: they assumed a boastful killer would begin with “I” and use the word “kill” a lot. The guess held.
The second cipher, 340 symbols long, arrived in November 1969 and resisted for 51 years. It was read only in December 2020, by David Oranchak in the United States, Sam Blake in Australia and Jarl Van Eycke in Belgium. A transposition had been added to the homophonic substitution: the symbols had to be read not along the rows but diagonally, one row down and two columns right at each step. With the wrong order, frequency analysis sees mush. The solvers found it by having a computer try hundreds of thousands of reading orders and scoring each one by its frequencies. The FBI confirmed the solution. The Zodiac himself has never been officially identified.
Kryptos: a puzzle in the CIA's courtyard
In November 1990 a sculpture by Jim Sanborn called “Kryptos” was installed at CIA headquarters in Langley, Virginia: a curving copper sheet cut through with about 870 letters. Sanborn worked with a recently retired head of the CIA's cryptographic center. The text has four parts, K1 to K4.
The first three were read in the 1990s. The computer scientist Jim Gillogly published a solution in 1999; it later emerged that analysts at the CIA and the NSA had read them earlier. K1 and K2 are Vigenère ciphers with a mixed alphabet, keyed with PALIMPSEST and ABSCISSA. K3 is a transposition and paraphrases the archaeologist Howard Carter's account of opening Tutankhamun's tomb. Sanborn left deliberate misspellings in the text, which became clues in their own right.
The fourth part, K4, just 97 characters, remains the most famous unsolved cipher in the world: no method for reading it has been publicly shown. Sanborn has given clues. In 2010 he revealed that characters 64–69 decrypt to BERLIN, and in 2014 that the next five read CLOCK. Thousands of amateurs are still at it. If you want to join them, the cipher identifier and the Vigenère tool are a start, but expect a long haul.
Why is K4 so stubborn? The text is short: 97 characters are too few for reliable frequency analysis. And the method is unknown; it may not be one classical cipher at all but a chain of steps of the author's own devising. A short text plus an unknown method is a combination that defeats people and computers alike.
What do the three broken cases, Mary's letters, the Zodiac 408 and the Zodiac 340, have in common?
A nomenclator and a homophonic substitution are substitutions with trimmings. Nulls, extra symbols and transposition delay the end, but the language shows through. The codebreaker has to find how to read the symbols; the frequencies do the rest.
What to take with you
- A nomenclator is substitution plus code plus nulls. It holds out longer, but a long correspondence gives it away to frequencies.
- A code replaces whole words with numbers from a book. Having broken a code, it pays to keep quiet, or the code gets changed.
- A book cipher is strong while the book is unknown and each letter has many numbers. But in Beale's case there was probably nothing to solve.
- A short text and an unknown method are a cipher's best friends. That is why Kryptos K4 is still unread.
- Almost every historical cipher fell not to brute force but to good guesses: about the language, the crib, the person at the other end.
The course is done. You know how shifts and substitutions work, Vigenère and transpositions, Morse and Base64, steganography and Enigma, XOR, hashes and public keys. Time to put it all together. Behind eight doors are eight ciphers, and each door opens with the answer to the one before. Those who get through enter the hall of fame. Enter the Eight Doors quest →
Tools for this lesson
Everything from the lesson, working: paste your own text.
- Cipher identifier Paste a ciphertext and the analyser suggests what it may be: Caesar, Vigenère, Base64, Morse, hex…
- Frequency analysis Letter and bigram frequencies and the index of coincidence, against English or Russian.
- Vigenère cipher: encoder and cracker Vigenère and Beaufort: encode with a key, or crack without one — key length from the index of coincidence.
- Substitution cipher Keyword or custom-alphabet substitution: encode, decode and crack letter by letter.