Chris Spackman's NeoCities Page

Codebooks: A History

Before you can understand the codebreaking of the Zimmermann Telegram or the Black Chamber, you need to understand the tool they were breaking: the codebook. Codebooks are fundamentally different from ciphers. Where a cipher transforms individual letters according to a mathematical rule, a code replaces entire words or phrases with arbitrary symbols. There is no formula — just a very large dictionary that both sender and receiver must possess.

Codebooks dominated secret communication for centuries, and they were still the primary tool of diplomacy when World War I began. Understanding how they work — and why they are both powerful and vulnerable — is essential background for everything else in this section.

Codes vs. Ciphers

The distinction matters:

Cipher Code
Unit Individual letters Whole words or phrases
Key A rule or algorithm A codebook (dictionary)
Example A→D, B→E, C→F ATTACK→7392, DAWN→2841
Flexibility Can encode any text Limited to what is in the book
Vulnerability Frequency analysis Captured codebooks, pattern analysis over time

In practice, many historical systems combined both: a codebook for common words plus a cipher for anything not in the book. These hybrid systems were called nomenclators.

A Brief History

Nomenclators (1400s – 1800s)

The earliest code systems were nomenclators, widely used in European diplomacy from the Renaissance onward. A nomenclator was typically a table with two parts:

The sender would use the code list for important words and the cipher alphabet for everything else. This was a significant improvement over pure ciphers, because the coded words were invisible to frequency analysis. However, the cipher portion was still vulnerable, and skilled cryptanalysts could use the decoded cipher text to guess the coded words from context.

Mary Queen of Scots (1586)

One of the most famous failures of a nomenclator. Mary Stuart used a nomenclator to communicate with conspirators plotting to assassinate Queen Elizabeth I. Sir Francis Walsingham's codebreaker, Thomas Phelippes, broke the nomenclator and read the messages. The decoded letters were used as evidence at Mary's trial, and she was executed in 1587. The nomenclator's cipher portion was too weak to protect the coded words once the surrounding text was readable.

The Great Cipher (1600s)

Not all early codes were easy to break. Antoine and Bonaventure Rossignol created the Great Cipher for King Louis XIV of France in the late 1600s. It was a codebook that used 587 different numbers to represent syllables, individual letters, and whole words. Some numbers were nulls (meaningless filler) and others were traps that meant "ignore the previous number." The Great Cipher was so effective that it was not broken until 1893, when the French military cryptanalyst Étienne Bazeries finally cracked it after three years of work.

Telegraph Codes (1800s)

The invention of the telegraph in the 1830s created a new use for codebooks: saving money. Telegraph companies charged by the word, so businesses created codebooks that compressed common phrases into single codewords. A message like "Ship 500 barrels of flour by fastest available route" could be sent as a single five-letter codeword.

Commercial telegraph codes were published and sold openly — there was no secrecy involved. But governments quickly realized the same principle could be used for secret communication. Diplomatic codebooks combined the cost savings of telegraph codes with the security of secret code assignments.

Diplomatic Codebooks (1850s – 1940s)

By the late 1800s, every major government maintained secret codebooks for diplomatic communication. These were typically large volumes — sometimes containing 10,000 to 100,000 entries — mapping words, phrases, and even complete sentences to four- or five-digit number groups.

A diplomatic codebook had two sections:

Important codebooks were treated as highly classified material. They were printed in limited quantities, distributed to embassies by diplomatic courier, and were supposed to be destroyed if capture was imminent. When a codebook was compromised, every copy worldwide had to be replaced — an expensive and time-consuming process.

Superencipherment

To add an extra layer of security, many nations used superencipherment: after encoding a message with the codebook, they would then encipher the code numbers using a second key. For example, if the codebook produced the number group 7392, and the superencipherment key for that position was 1548, the transmitted group would be 7392 + 1548 = 8940 (some systems instead added digit by digit without carrying, which here would give 8830).

This meant that even if an enemy had a copy of the codebook, they still could not read messages without also knowing the superencipherment key, which was changed regularly.

Codebooks in World War I

When World War I began in 1914, codebooks were the primary method of secret diplomatic and military communication. The major systems included:

The SKM Codebook

One of Room 40's earliest and most important captures was the German naval codebook, the Signalbuch der Kaiserlichen Marine (SKM). It was recovered from the German cruiser Magdeburg, which ran aground in the Baltic in August 1914. Russian divers found the codebook in the arms of a drowned German sailor, and Russia shared it with Britain. This single captured codebook gave Room 40 the ability to read German naval communications for much of the war.

Try It: Build a Codebook

Create your own mini codebook by assigning code numbers to words. Then use it to encode and decode messages. This exercise demonstrates both the power and the limitations of code systems.

Your Codebook

Encode a Message

Decode a Message

Strengths and Weaknesses

Why Codebooks Were Powerful

Why Codebooks Were Vulnerable

The End of the Codebook Era

Codebooks dominated secret communication through World War I and into the 1920s and 1930s. But they were gradually replaced by cipher machines — mechanical and electromechanical devices like the Enigma machine that could encipher messages automatically using complex, machine-generated substitution patterns. Cipher machines were faster, more flexible, and could change their keys daily (or even per message), whereas replacing a codebook could take months.

But the techniques developed to break codebooks — pattern analysis, contextual guessing, cross-referencing messages, and the statistical methods of William Friedman — carried directly over to the new challenge of breaking cipher machines. The codebreakers of the codebook era became the founders of modern cryptanalysis.

Things to Try

Disclaimer: these pages are educational demos provided as-is, with no warranty of any kind. The author is not responsible for any consequences arising from their use.

Send comments and bug reports to chris@chrisspackman.com.

Version 0.1.1 — Last updated: 2026-07-02

This page is Copyright © 2025 – 2026 Chris Spackman <chris@chrisspackman.com>.
This web site developed entirely on GNU/Linux with Free / Open Source Software.

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Creative Commons License