Hidden Meanings

Secret Writing: A History of Codes, Ciphers and Codebreaking 🏆

Course 1 · Chapter 1 · Hidden Meanings

The Greek historian Herodotus tells of a man who shaved a servant's head, wrote a message on his scalp, waited for the hair to grow back and sent him on his way. When the servant arrived, the recipient shaved him again and read the order. It is a charming story, and a good one to start with, because it shows the oldest problem in the subject: how do you send a message so that only the right person can read it? This course follows that problem from antiquity to the eve of the modern computer. This first chapter sets out why people hide messages and gives you the handful of words you will need for the other eleven.

Why Hide a Message?

Almost every reason comes down to the fact that messages travel through hands you do not control.

War and statecraft

A messenger can be captured. Generals, kings and governments have always needed orders and reports to survive an enemy interception.

Trade and money

Merchants guard prices, routes and suppliers. Later, telegraph companies and banks protected payments.

Love, faith and dissent

Lovers, persecuted believers and conspirators have all used hidden writing because being discovered carried a heavy cost.

Play and prestige

Puzzles, riddles and secret alphabets have long been a game in themselves, and some secrets were kept simply to show that one had them.

Two Ways to Keep a Secret

There are two very different ideas, and the history of the subject is partly the story of how they have competed and combined.

SteganographyCryptography
HidesThat a message exists at allWhat the message says
Looks likeSomething ordinary: a blank tablet, a harmless letter, a bare scalpObvious gibberish or odd symbols
WeaknessOnce the trick is spotted, the message is simply readAn interceptor knows there is something worth breaking
Greek roots"concealed" + "writing""hidden" + "writing"

Herodotus also describes Demaratus, an exile, who warned Sparta of a Persian attack by scratching the message onto the wooden base of a wax writing tablet and then covering it with fresh wax, so that the tablet looked blank. Both stories are steganography: the secret lies in the hiding place. A cipher, by contrast, can be sent openly across a table, because the page is useless without the key.

The two combine well. A message can be enciphered and then hidden, so that an enemy must first find it and then break it. Much later in the course you will meet modern versions of both.

Not Yet Verified The Herodotus stories are famous but come from one ancient author, and he is known for telling a good tale. Sources differ on the date of the shaved-scalp episode (around 500 BC in one account, and a different date in another), so treat the stories as well-attested legend rather than proven fact. They were checked against one web search (reference articles on steganography); the details and dates were not verified against a scholarly edition of Herodotus.

The Vocabulary

People often say "code" for everything. Historians and cryptographers do not, and the difference is useful from now on.

TermMeaningExample
PlaintextThe readable message before it is hiddenATTACK AT DAWN
CiphertextThe scrambled form after encipheringBUUBDL BU EBXO
CipherA rule that works on letters (or symbols), one by one or in small groupsShift every letter one place along the alphabet
CodeA list that replaces whole words or phrases with other words, numbers or symbolsA codebook entry: PLUM means "attack at dawn"
KeyThe piece of secret information needed to encipher or decipher"Shift by one", or a keyword
Encipher / decipherTo scramble with, or unscramble with, the keyThe sender enciphers; the recipient deciphers
CryptanalysisReading a message without the key; codebreakingAn interceptor working it out
Break versus decipher The intended recipient deciphers, because they hold the key. An outsider breaks the cipher, because they do not. The words sound alike, but the history is mostly about the second.

A cipher and a code, side by side

Here is the same message treated both ways. The cipher shifts each letter one place on (A becomes B, B becomes C). The code replaces the whole phrase with a word agreed in advance.

Plaintext : ATTACK AT DAWN Cipher : BUUBDL BU EBXO (each letter shifted by one) Code : PLUM (one codebook entry for the whole phrase)

The code is short and fast, but both sides need the same book, and it only covers the phrases someone thought to include. The cipher can say anything, but it is longer and, as you will see, easier to attack the more text it carries. Both remain in use together through most of the course.

Key terms at a glance Steganography hides the existence of a message. Cryptography hides its meaning. A cipher works on letters; a code works on words and phrases. A key is the secret that makes the difference between reader and outsider.

Kerckhoffs's Idea, Early

One principle will keep coming back. A good system should still be safe if the enemy knows how it works and lacks only the key. Systems that depend on the method itself staying hidden tend to fail the day a clerk is captured or bribed. This idea is named after the nineteenth-century Dutch-born linguist Auguste Kerckhoffs, who stated it formally (check the exact wording and date), though people discovered it the hard way long before he wrote it down.

What the Course Covers

ChaptersTheme
2–3Ancient ciphers, and the Arab scholars who first broke them by counting letters
4–6Renaissance cipher offices, the "unbreakable" cipher that was broken, and spymasters
7–9Telegraph codebooks, rotor machines, and the wartime codebreakers
10–11The Cold War, then the invention of public-key ideas
12Unsolved puzzles, and how to make your own
Where the technical side lives This is a story-first history with hand-solvable puzzles; it assumes nothing beyond arithmetic. For how modern encryption is actually engineered, see Cryptography Fundamentals and HTTPS/TLS Fundamentals. This course ends roughly where those begin.
Try it yourself: the first puzzle Decipher this message, which was enciphered by shifting each letter one place forward in the alphabet (so decipher by moving each letter one place back):

TFDSFU XSJUJOH

Show the worked answer

Move each letter back one: T→S, F→E, D→C, S→R, F→E, U→T gives SECRET; X→W, S→R, J→I, U→T, J→I, O→N, H→G gives WRITING. The plaintext is SECRET WRITING.

Exercises

Exercise 1

Sort each of these into steganography, cipher or code: (a) a message written on a shaved scalp and hidden by regrown hair; (b) every letter replaced by the one two places further on; (c) a book in which "MAPLE" stands for "the shipment has left"; (d) a message written in lemon juice that appears only when heated; (e) a letter written in symbols that look like nonsense.

Exercise 2

A tiny codebook says: PLUM = attack at dawn; CEDAR = hold the bridge; HERON = send more supplies. (a) Write the code message for "hold the bridge, send more supplies". (b) A friend decodes "HERON" as "send more". What goes wrong, and what does it say about the limits of codes compared with ciphers?

Exercise 3

Read the first letter of each line of this note: "Carefully check the shed. / Isn't the door open? / Peter said nothing. / Hurry, please. / Every light was off. / Remember the gate." What is hidden in it? Is this steganography or cryptography, and why? Then write one innocent-looking sentence of your own that hides a word the same way.

Quick Reference

  • Steganography: hides that a message exists (scalp, wax tablet)
  • Cryptography: hides what a message says
  • Cipher: works on letters; code: works on words and phrases
  • Plaintext / ciphertext / key: the readable text, the scrambled text, the secret that links them
  • Decipher vs break: with the key, or without it
  • Check: the date of the shaved-scalp story, the exact wording and date of Kerckhoffs's principle

Next chapter: Ancient Secrets, which looks at the Spartan scytale, the Caesar shift and the Hebrew Atbash cipher, the first ciphers worked entirely by hand.