15 Minutes
Cover of The Code Book

Science · 15 min

The Code Book

Simon Singh · 1999

Who it's for

Original title (Portuguese): O Livro dos Códigos. This is for you if you use passwords, payment apps and messaging apps every day and have never stopped to wonder how all of that stays protected. It also suits anyone who likes stories of espionage, war and mathematics told without heavy formulas.

Read it in the app

⚡ Free to download • 🎁 One full book free every day

3 ideas to take with you

1

Trusting a protection without testing it against a clever adversary is one of the most expensive forms of optimism.

2

Finding a flaw and keeping the discovery to yourself can delay the credit for decades, as happened to the people who broke the most famous cipher of the sixteenth century.

3

Digital privacy is not just for people with something to hide, but for anyone who has something to protect, like a bank account or an intimate conversation.

“
Every language leaves fingerprints, and whoever learns to count letters can read what seemed unreadable.
An idea from The Code Book, in the words of 15 Minutes

Preview

Start reading now

The letter that cost a queen her head

In 1586, Mary Stuart, Queen of Scots, had been a prisoner in England for almost twenty years. A group of young Catholics, led by Anthony Babington, planned to free her and kill Elizabeth I. To arrange everything, they exchanged letters written in cipher, and Mary trusted that no outsider could read them.

The problem is that the spy network of Francis Walsingham, the queen's minister, intercepted every message. A specialist named Thomas Phelippes applied frequency analysis, decoded the letters and even forged a postscript asking for the names of the conspirators. Mary answered in writing, approving the assassination.

That piece of paper served as evidence at her trial, and she was executed in 1587. Singh opens the book with this scene because it shows the whole thesis: a code is worth only as much as it resists the enemy, and trusting a weak cipher can cost you your life. Today, the lesson looks a lot like that of someone who uses the same weak password everywhere and thinks they are protected.

Hide the message or scramble the message

Singh separates two ancient ways of keeping a secret. Steganography hides the existence of the message: the Greek Demaratus shaved a slave's head, tattooed the warning about the Persian invasion on it and waited for the hair to grow back. Invisible inks and texts hidden inside other texts follow the same logic.

Cryptography does the opposite: the messenger can be caught and the letter read, but the content stays unreadable. It has two families. In transposition, the letters change places. In substitution, each letter is swapped for another letter or for a symbol.

Steganography has an obvious flaw: if the carrier is searched, the secret is gone. That is why cryptography won out and became the center of the story. Think of a folded note in your pocket: hiding the note is one thing, and writing it so that nobody can understand it even after finding it is another. The book argues that both ideas still live side by side today, even in digital files.

Caesar's cipher and the problem of combinations

The most famous substitution carries the name of Julius Caesar, who shifted each letter of the alphabet by a fixed number of places. With a shift of three, A became D, B became E, and so on. It is simple to apply and simple to undo, but in ancient Rome it already gave a certain advantage.

When the scrambling stops being a shift and becomes any possible swap between letters, the number of arrangements explodes. The alphabet alone has more than four hundred septillion possible orders. For centuries this gave the impression that the cipher was unbreakable, because nobody would try every key one by one.

The key, here, is the rule agreed on by the sender and the receiver. Singh insists on an idea that comes back until the end: security should not depend on hiding the method, but on keeping only the key secret. Anyone who thought that lots of combinations were enough was mistaken.

11 more sections and the quiz

Continue in the app

Read the whole summary, finish with the The Code Book quiz and follow the guided Journeys. No ads in the app.

About Simon Singh

Simon Singh was born in 1964 in England and earned a doctorate in particle physics at the University of Cambridge. He worked at CERN, in Switzerland, before joining the BBC as a producer and director of science programs. He directed a documentary about Fermat's last theorem and wrote a book on the same subject. The Code Book came out in 1999, and he is also the author of Big Bang.

Explore

Category:
Science