दुर्गा बेरागी Durga Beragi, homeEnter the study →

Library › Cryptography, blockchain and crypto

The Codebreakers: The Story of Secret Writing

David Kahn · 1967 · Macmillan

Four thousand years of ciphers and the people who broke them.

About the book

David Kahn, a journalist and historian, published The Codebreakers in 1967. At over a thousand pages, it was the first comprehensive history of cryptology for general readers. Kahn traces secret writing from ancient Egypt, India and Greece through the Arab scholars who first described frequency analysis, the cipher offices of Renaissance Europe, the American Civil War, the First World War and its Zimmermann telegram, and the Second World War, including the American breaking of Japanese codes before Midway. He also covers the National Security Agency, the anatomy of codes and ciphers, and unsolved puzzles. Because the British breaking of Enigma was still secret, it is barely covered. A 1996 revision added a chapter on public-key cryptography.

Key ideas

  • Secret writing is nearly as old as writing itself. Kahn shows it arising independently in many civilisations, from ancient Egyptian scribes to Indian, Greek and Chinese practices.
  • Arab scholars were the first known to describe cryptanalysis by letter frequency. Counting how often letters appear defeats simple substitution ciphers, which made cryptanalysis a science rather than guesswork.
  • Codebreaking has decided wars and diplomacy. The decoding of the Zimmermann telegram helped bring the United States into the First World War, and breaking Japanese naval codes shaped the battle of Midway.
  • Cipher systems fail more often through human error and careless procedure than through mathematical weakness. Repeated keys, predictable messages and lazy operators give codebreakers their openings.
  • Every advance in making ciphers has been met by an advance in breaking them. The contest between codemakers and codebreakers drives both forward and is never settled for long.
  • Communications intelligence became a large state enterprise in the twentieth century. Kahn's account of the National Security Agency was one of the first public descriptions of its work.

Why it is on this shelf

Every blockchain and every secure app stands at the end of this long history. Kahn shows why encryption has always been about power, war and trust, and why systems break at the human edges. It is long, but it is the record against which all later histories are measured.

How to start reading it

Read the opening chapter on Pearl Harbor and Midway for the stakes, then the chapters on the Arab contribution and the Renaissance. After that, read selectively by period. The 1996 edition's final chapter covers public keys.

About this book

The Codebreakers was published by Macmillan in 1967. Its author, David Kahn, was a journalist who had been fascinated by secret writing since boyhood, and who spent years gathering everything he could find about it. The result was a book of more than a thousand pages, the first comprehensive history of cryptology written for the general reader. It covers some four thousand years, from scribes in ancient Egypt to the giant signals-intelligence agencies of the Cold War.

Cryptology is the science of secret communication. It has two halves. Cryptography is the making of codes and ciphers, the methods that turn a readable message into something an outsider cannot read. Cryptanalysis is the breaking of them, the art of recovering the message without being given the key. Kahn's book is about both, but its heart is in the second. It is a history of the people who read other people's secrets, and of what they did with what they read.

Before Kahn, the history of the subject was scattered. There were technical manuals, a few popular books, memoirs by retired practitioners, and many myths. Governments treated the subject as secret, and much of the most important work of the twentieth century was still classified. Kahn set out to gather the whole story from public sources, interviews, archives and his own decoding of the technical literature, and to tell it accurately. He wanted a reader to understand how ciphers work, how they are broken, and why the contest between the two has mattered so much to war, diplomacy and politics.

The book appeared in the middle of the Cold War, when the existence of America's largest intelligence agency was barely acknowledged. Kahn's account of that agency was among the first serious public descriptions of its work. Government officials were concerned about the book before it appeared, and there were discussions about what it should contain. The book was published, and it became a landmark. For decades it was the standard history, and it shaped how practitioners, historians and the public thought about the subject.

The question it sets out to answer

The book asks a large question in historical form. What has secret writing been, across all of human history, and what difference has the ability to make and break it made? Kahn's answer is that secret communication is a constant of civilisation, that its makers and breakers have been locked in a long contest whose outcome has repeatedly changed history, and that the contest has grown from the hobby of scholars and courtiers into a vast enterprise of states.

An important gap

One major story is almost missing. During the Second World War, British codebreakers at Bletchley Park, building on Polish work, broke the German Enigma machine and other systems. This achievement was kept secret until the mid-1970s, years after Kahn's book appeared. Kahn therefore says little about it. He later wrote a separate book on the naval side of the Enigma story. A revised edition in 1996 added a chapter on public-key cryptography, the invention of the 1970s that transformed the field, but the main body of the book remained as first written. Readers should keep this gap in mind and fill it from later books.

The author

David Kahn was born in New York in 1930. As a boy he read a popular book on cryptography by Fletcher Pratt and became absorbed by the subject. He studied at Bucknell University and became a newspaper journalist, working for Newsday on Long Island and later for the International Herald Tribune in Paris. Journalism gave him the habits that made The Codebreakers possible: persistence in finding sources, a nose for a story, and the ability to explain complicated things to ordinary readers.

The book grew out of an article he wrote in the early 1960s, prompted by the defection of two employees of the National Security Agency to the Soviet Union. Working on the article showed him how little reliable history of the field existed. He took on the task of writing it, and spent years on research, tracking down archives in several countries, interviewing veterans and teaching himself the technical side of cryptanalysis.

After The Codebreakers, Kahn went on to earn a doctorate in history at Oxford. His thesis became Hitler's Spies, a study of German military intelligence in the Second World War, published in 1978. He later wrote Seizing the Enigma, on the breaking of German naval ciphers, and The Reader of Gentlemen's Mail, a biography of Herbert Yardley, the colourful head of an early American codebreaking office. He helped found the scholarly journal Cryptologia and was widely regarded as the dean of historians of the subject. He gave his large collection of books and papers to the National Cryptologic Museum. He died in 2024.

Kahn's background matters for how to read the book. He was not a mathematician or an intelligence officer. He was a meticulous outsider who earned the trust of insiders. His strengths are breadth, narrative and accuracy about events. His explanations of technique are clear but aimed at the general reader, and his views on intelligence agencies are those of a well-informed citizen, admiring their skill while aware of their power.

The shape of the argument

The book is organised partly by time and partly by theme. It opens not at the beginning of history but in the middle of the twentieth century, with the American breaking of Japanese diplomatic ciphers before and during the attack on Pearl Harbor. Kahn uses this to show the stakes at once: lives, battles and the fate of nations turning on who could read whose messages. Only then does he go back to the beginning.

The long middle of the book follows the history forward. It begins with the first traces of secret writing in the ancient world, moves through the classical world and the medieval Arab scholars who founded cryptanalysis, and then through the cipher offices of Renaissance Italy, the black chambers of early modern European courts, and the codes of the age of the telegraph. The two world wars receive very full treatment, as do the agencies that grew out of them. The narrative is not purely chronological; Kahn often follows one country or one institution through a period before turning to another.

Interleaved with the history are chapters that step back from narrative to examine the subject itself. These cover the anatomy of codes and ciphers, the relationship between cryptology and linguistics, the decipherment of lost scripts, the use of secret writing by criminals and by amateurs, famous unsolved puzzles, claims of hidden ciphers in literature, and the question of how one might communicate with intelligent beings elsewhere in the universe. These chapters show how widely the ideas of cryptology reach.

The argument that runs through the whole is not stated as a thesis on one page. It emerges from the accumulation of cases. Secret writing appears wherever there are secrets and writing. Every cipher eventually meets a breaker. Systems usually fail through human error rather than mathematical weakness. The ability to read an opponent's messages is among the most valuable kinds of intelligence. And over the centuries the enterprise has grown from individual genius to industrial organisation.

A reader should not expect a tight structure. The book is vast and generous, full of digressions, characters and anecdotes. Its organisation serves its encyclopaedic ambition. That is part of its charm and part of its difficulty.

Kahn's method

Kahn writes history through people. Nearly every technical idea in the book arrives attached to a person: a scribe, a cipher secretary, a bishop, an officer, a married pair of codebreakers, a defector. He gives physical descriptions, quirks and moments of triumph or failure. This makes a long book readable, and it also carries a view of the subject. For Kahn, cryptology is not an abstract mathematics but a human craft, practised under pressure by individuals whose skill, patience and luck change events.

He also explains. At key points the narrative pauses so the reader can follow how a particular system worked and how it was broken, often with a small worked example. These explanations are the best way for a non-specialist to learn classical cryptanalysis, and a reader who follows them with a pencil will come away able to break simple ciphers. Kahn trusts the reader to keep up, and rewards the effort.

Finally, he is scrupulous about sources. The book has extensive notes, and Kahn is careful to distinguish what is documented from what is legend. Many popular stories about codes, repeated for generations, are quietly corrected in his pages. That care is one reason the book became a reference rather than just a popular history.

The result is a book that can be read in two ways at once: as a sweeping story of secrets across the ages, and as a patient textbook of the classical craft. Most readers will lean toward one or the other, and both are rewarded. A reader who starts as a lover of stories often ends up breaking ciphers for fun, and a reader who starts with the puzzles often ends up caring about the history.

Secret writing is nearly as old as writing

The first key idea is that the urge to hide meaning in writing is ancient and universal. Kahn finds traces of it in many civilisations that had no contact with one another. This suggests that secret writing is not the invention of one culture but a natural response to a basic human situation: someone has information that others want, and must send it where others might see it.

Egypt and the first transformations

Kahn begins with an inscription in an Egyptian tomb from about four thousand years ago, in which a scribe used unusual hieroglyphic forms in place of the ordinary ones. The purpose was probably not secrecy in the modern sense. It may have been to give the text dignity or mystery, or to show the scribe's learning. But it contains the essential move of cryptography: a deliberate transformation of writing so that it is not read in the ordinary way. Later Egyptian texts used such transformations more extensively, sometimes for religious reasons, to make sacred words harder for the uninitiated to understand.

India, Mesopotamia, China and Greece

Kahn notes that ancient Indian texts recognised secret writing as a skill. A well-known classical Indian treatise on the arts of life lists secret writing among the sixty-four arts that a cultivated person should know, and texts on statecraft discuss the use of spies and secret messages. In Mesopotamia, a clay tablet records a formula for pottery glaze written in a deliberately obscure way, to protect a valuable trade secret. Chinese practice included concealing messages physically. The Greeks of Sparta are traditionally said to have used a staff around which a strip was wound for writing, so that the message could only be read when wrapped around a staff of the same thickness; this is a transposition cipher, rearranging letters rather than replacing them. Greek and Roman writers also described methods of hiding messages, such as writing on a shaved head and letting the hair grow back.

Hiding versus scrambling

These examples show a distinction that Kahn draws carefully. Some methods hide the existence of a message. This is steganography, from Greek words meaning covered writing: invisible inks, hidden compartments, messages tattooed under hair. Other methods leave the message in plain view but make it unreadable. This is cryptography proper. The two can be combined. Steganography fails as soon as the message is found. Cryptography is meant to hold even when the message is captured, and this is why it became the more important and more studied branch.

Why it matters

The universality of secret writing is more than a curiosity. It tells us that the problem cryptography solves is permanent. As long as people communicate across distance and have interests that conflict, someone will try to hide messages and someone else will try to read them. The tools change, from clay and papyrus to radio and computers, but the situation does not. An analogy: locks are found wherever there are doors and property, in many forms but with the same purpose. Ciphers are the locks of language.

The birth of cryptanalysis

The second key idea is that cryptanalysis, the systematic breaking of ciphers, was a real intellectual invention, and that it was first described by Arab scholars in the medieval Islamic world. Before them, there were ciphers but no recorded method for breaking them. After them, the contest between makers and breakers was on.

Letter frequency

The fundamental idea is simple to state. In any language, letters occur with characteristic frequencies. In English, for example, some letters are very common and others very rare. A simple substitution cipher replaces each letter with another symbol but keeps the frequencies intact. The symbol that stands for the most common letter will itself be the most common symbol in the ciphertext. Counting how often each symbol appears, and matching the counts with known letter frequencies, gives the codebreaker a foothold. Further clues, such as common pairs of letters and short common words, complete the solution.

Kahn credits the origin of this method to Arab scholars, whose civilisation had the necessary ingredients: high literacy, advanced mathematics, careful study of language, and a tradition of close textual analysis of the Quran, including counting the occurrence of letters and words. In his first edition he drew mainly on a fifteenth-century encyclopaedia that preserved earlier work. After the book appeared, scholars brought to light a much earlier treatise on the subject by the ninth-century philosopher al-Kindi, which pushed the known origin of frequency analysis back by several centuries. This discovery strengthens Kahn's general claim that cryptanalysis was born in the Arab world.

An everyday picture

Imagine a puzzle in a newspaper in which each letter of a famous saying has been replaced by another letter. A practised solver looks for single-letter words, which in English are almost always one of two letters, and for the most frequent letter, which is very likely a particular vowel. Within minutes the saying appears. This is frequency analysis, and it defeats any cipher that replaces each letter with one fixed substitute, however strange the substitutes look.

Why it matters

Frequency analysis turned codebreaking from guesswork into a method. Once it existed, simple substitution was finished as a serious means of protecting secrets. Every later development in cipher-making can be seen as an attempt to defeat frequency analysis, and every later development in codebreaking as an extension of its basic insight: that language leaves statistical fingerprints, and that disguises which preserve those fingerprints can be seen through. This insight lies at the base of all modern cryptanalysis, which is at heart a branch of statistics.

What this is often confused with

The story is sometimes told as if a single brilliant individual invented codebreaking in a flash. Kahn's account, and the later scholarship, show something different: a culture of learning in which the study of language, mathematics and administration came together. The lesson is that intellectual breakthroughs often come from the meeting of fields, not from isolated genius.

The Renaissance and the professional codebreaker

The third key idea is that codebreaking became a profession, practised by trained specialists in permanent offices, in the city-states and monarchies of early modern Europe. This shift from occasional skill to institution is one of the turning points of the book.

Diplomacy and the cipher secretary

As the Italian city-states developed permanent diplomatic missions in the fifteenth century, they needed to protect their dispatches. Venice, Florence, the Papal States and others employed cipher secretaries who designed systems and broke those of rivals. Kahn describes how Venice in particular built a formal service with schools, examinations and strict secrecy. Codebreaking became a career with recognised skills and rewards.

Nomenclators

The typical system of the age was the nomenclator, a combination of a cipher alphabet for spelling out words and a list of code words or symbols for common names, places and phrases. Nomenclators grew over the centuries from a few dozen entries to thousands. They were the standard tool of diplomacy for about four hundred years. Kahn shows how their designers tried to defeat frequency analysis by providing several symbols for common letters and by adding meaningless symbols, called nulls, to confuse the count.

The polyalphabetic idea

Kahn gives great attention to the Renaissance invention of polyalphabetic ciphers. The idea, usually credited first to the architect and scholar Leon Battista Alberti in the fifteenth century, is to use more than one cipher alphabet and switch between them during a message. Then the same plain letter may be enciphered in different ways at different points, and the frequencies are smeared out. Alberti built a cipher disk, two concentric rings of letters, to make switching easy. Later writers, including the abbot Trithemius, Giovan Battista Bellaso, Giovanni Battista Porta and Blaise de Vigenère, developed the idea into systems using a keyword to control the switching. One such system, later named after Vigenère, was for centuries called indecipherable.

The black chambers

By the seventeenth and eighteenth centuries, major European states maintained secret offices, often called black chambers, that intercepted, opened, copied and resealed diplomatic mail, and decoded it. Kahn describes the French office under the Rossignol family, who served Louis XIII and Louis XIV, and whose own great cipher resisted solution until the end of the nineteenth century. He also describes the Viennese office, famous for its speed and efficiency, which could open, copy and reseal letters and return them to the post within hours. These were the ancestors of the modern intelligence agency.

Mary Queen of Scots

Kahn tells the story of how the secret correspondence of Mary Queen of Scots with conspirators planning the murder of Elizabeth I was intercepted and deciphered by Elizabeth's agents. The decipherment provided the evidence that led to Mary's execution in 1587. It is one of the clearest early examples of a cipher's failure costing a life, and of codebreaking shaping the history of a nation.

Why it matters

The professional era established patterns that continue today. States treat communications as a resource to be defended and attacked. Specialists build careers in secrecy. Systems grow more elaborate, and breakers grow more organised. The cipher secretary of Venice and the cryptanalyst at a modern agency are doing recognisably the same job.

The telegraph and the open channel

The fourth key idea is that changes in communication technology reshape cryptology. Kahn shows this most clearly with the electric telegraph in the nineteenth century, and later with radio. Each new channel made communication faster and wider, and each exposed more messages to interception.

Messages in other hands

Before the telegraph, a diplomatic letter travelled with a courier or through the post. Intercepting it required physical access. A telegram, by contrast, passed through the hands of clerks and operators who read it as they transmitted it, and through wires that could be tapped. Businesses and governments that wanted privacy had to encipher their telegrams. Commercial codebooks appeared, partly for secrecy and partly to save money, since telegraph companies charged by the word and a single code word could stand for a whole phrase.

At the same time, the telegraph made complex hand ciphers impractical in the field. Armies needed systems that could be used quickly by ordinary soldiers under pressure. This created a lasting tension that Kahn returns to again and again: secure systems tend to be slow and error-prone, and fast systems tend to be insecure. The history of military cryptography is largely the history of attempts to escape this trade-off.

The fall of the indecipherable cipher

The polyalphabetic cipher with a repeating keyword had long been considered unbreakable. In the nineteenth century it fell. A Prussian officer, Friedrich Kasiski, published a general method in 1863, and the English mathematician Charles Babbage appears to have found a solution earlier but did not publish it. The insight is that if a keyword repeats, the same stretch of plain text enciphered at the same position in the keyword will produce the same stretch of cipher text. The distances between repeated stretches reveal the length of the keyword. Once the length is known, the cipher splits into several simple substitutions, each of which falls to frequency analysis.

An analogy helps. Imagine a disguise that changes every hour on a fixed rotation of five costumes. If you can work out that the rotation has five steps, you can study each costume separately, and each by itself is easy to see through. The weakness of the cipher was its repetition.

Kerckhoffs and the principles of design

In 1883 the Dutch-born linguist Auguste Kerckhoffs published an influential study of military cryptography. Kahn treats it as a founding document of the modern field. Its most enduring principle is that the security of a system should not depend on keeping the method secret, only on keeping the key secret. Methods will be captured, betrayed or reasoned out; a system that fails as soon as the method is known is no system at all. Kerckhoffs also laid down practical requirements: a field system must be usable by one person, must not require long rules, and must be portable.

This principle is now basic to all serious cryptography. Modern encryption methods are published openly and studied by everyone; only the keys are secret. Systems that rely on keeping their workings hidden are viewed with suspicion. Kahn's account shows that this wisdom was learned the hard way, through centuries of systems that seemed secure only because their method was not yet known.

Radio

Radio, arriving at the start of the twentieth century, removed the last barrier to interception. Anyone with a receiver in range could hear a transmission. Military radio made communication with ships, aircraft and moving armies possible, but it gave the enemy every message for the taking. From then on, the security of a military message rested entirely on its encryption. Kahn shows that many commanders were slow to understand this.

War and the reading of messages

The fifth key idea is that codebreaking has repeatedly decided the outcomes of wars and diplomatic crises. Kahn's long chapters on the First and Second World Wars make this case with many examples. They are the most dramatic part of the book.

The First World War

Kahn describes the Russian army in the opening weeks of the war sending radio messages in plain language, or in ciphers the Germans could easily read, and the German army using this knowledge to encircle and destroy Russian forces at Tannenberg. He describes the French, who had built a capable codebreaking service before the war, reading German messages throughout the conflict. He tells how a French officer, Georges Painvin, broke a German field cipher in 1918 under extreme pressure, giving warning of an offensive.

The British naval codebreaking office, known as Room 40, worked from captured German codebooks and from intercepted radio traffic. Its most famous achievement was the decipherment of a telegram sent in early 1917 by the German foreign minister, Arthur Zimmermann, to the German minister in Mexico. The telegram proposed that if the United States entered the war, Mexico should ally with Germany and be rewarded with territory lost to the United States in the previous century. The British had to reveal the telegram without revealing that they were reading German diplomatic traffic, and they arranged matters so that the source seemed to be a copy obtained in Mexico. Published in the United States, the telegram inflamed opinion and helped bring the United States into the war.

Kahn treats the Zimmermann telegram as perhaps the single most consequential act of codebreaking in history. It shows both the power of the craft and its peculiar politics: the codebreaker's greatest triumphs often have to be hidden or disguised, because revealing them would end the flow of intelligence.

Between the wars

After the First World War, the United States had a small codebreaking office led by Herbert Yardley, which read Japanese diplomatic traffic during negotiations on naval limits in the early 1920s. The office was closed in 1929 by a secretary of state who considered reading other governments' mail improper. Yardley, unemployed, published a sensational book revealing its work, which alarmed several governments, including Japan's. Kahn tells this story with evident relish and some disapproval.

Meanwhile, the army's own cryptologic service, led by William Friedman, built the scientific foundations of modern American codebreaking. Friedman introduced statistical tools, such as the index of coincidence, a measure of how likely two randomly chosen letters in a text are to be the same, which helps reveal the structure of complex ciphers. His wife, Elizebeth Friedman, was also a gifted codebreaker who broke the codes of smugglers during Prohibition. Kahn's portraits of the Friedmans are among the most affectionate in the book.

The Pacific war

The book's opening chapter, on Pearl Harbor, describes the American reading of Japan's highest-level diplomatic cipher, produced by a machine the Americans called Purple. The intelligence from it was known as Magic. Kahn shows that the Americans could read Japan's diplomatic messages before the attack, but that these messages did not reveal the target. Failures in analysis, distribution and attention meant that the warnings that did exist were not acted upon. The lesson is that reading the enemy's messages is not the same as understanding his intentions.

Kahn's account of the battle of Midway in 1942 is one of the high points of the book. American naval codebreakers at Pearl Harbor, under Joseph Rochefort, had partly broken the Japanese navy's main operational code. They learned that a major attack was coming against a target designated by a short code group. To confirm that the target was Midway, they arranged for the base there to send a false message in plain language reporting a shortage of fresh water. Soon afterwards, a Japanese message reported that the target was short of water. With this confirmation, the American commander placed his much smaller carrier force in position to ambush the Japanese fleet, and won a victory that changed the course of the Pacific war.

Kahn also tells of the American interception of the travel plans of Admiral Yamamoto in 1943, which allowed American fighters to shoot down his aircraft, and of the many smaller ways in which codebreaking shaped the war at sea.

Why it matters

These stories make vivid a principle that applies far beyond war. Information about an opponent's intentions is enormously valuable, and the side that can read the other's messages without being read itself has a decisive advantage. But intelligence only matters if it reaches the right person in time and is believed. Kahn's history is as much about the organisation of intelligence as about the cleverness of codebreakers.

Security and speed in the field

The war chapters also show the field soldier's side of the problem. A general's dispatch can wait for careful encipherment. A platoon under fire cannot. Armies therefore used simple field codes and ciphers for tactical messages, accepting that they might be read, on the theory that the information would be stale before the enemy could act. Kahn shows that this theory often failed, because enemies broke field systems faster than expected, and because tactical messages revealed patterns that mattered at higher levels.

One famous response in the Pacific war was the use of speakers of Native American languages, especially Navajo, to pass messages by voice in their own language, with an added layer of coded vocabulary for military terms. Because the language was unwritten, little studied outside its community and very different from the languages the enemy knew, the method was fast and resistant to interception. It shows that security can come from rarity of knowledge as well as from mathematics, though such security depends on circumstances that cannot be relied on forever.

Systems fail at the human edges

The sixth key idea, perhaps the most practical in the book, is that ciphers are broken far more often through human error than through mathematical weakness. Kahn's history is full of systems that were strong in principle and failed in practice because of how people used them.

The kinds of error

The errors fall into recurring types. Operators reuse keys that should be used only once. They send the same message twice, once in a weak system and once in a strong one, giving the breaker a pair to compare. They begin messages with predictable phrases, such as formal greetings, routine reports or standard headings, which give the breaker a guess at the plain text. They fail to change keys on schedule. They send short test messages that reveal settings. They abbreviate in predictable ways. Each of these gives the breaker an opening that the mathematics alone would not.

Codebreakers have a word for a guessed piece of plain text: a crib. Much of the history of practical cryptanalysis is the history of finding cribs. The Midway water-shortage message was a deliberately planted crib. Weather reports, routine status messages and standard sign-offs have served as cribs in countless cases.

An everyday picture

Think of a strong lock on a front door. It may resist picking for hours. But if the owner leaves the key under the mat, or uses the same key for every door in the building, or writes the combination on the frame, the strength of the lock does not matter. Modern security engineering says the same thing in different words: attackers go for the weakest point, and the weakest point is almost always people and procedures.

The one-time pad

Kahn explains the one system that, used correctly, cannot be broken at all. In the one-time pad, each letter of the message is combined with a letter of a truly random key that is as long as the message and is never used again. Because every possible plain text is equally consistent with the cipher text, there is nothing for the breaker to find. The idea was developed during and after the First World War, in part by the American engineer Gilbert Vernam, who combined teleprinter signals with a key tape, and by Joseph Mauborgne, who saw that the key must be random and never reused.

The one-time pad shows the human-edge principle in its purest form. Its mathematical security is perfect. Its practical security depends entirely on making, distributing and destroying vast amounts of key material without error. When keys have been reused, as happened in some Soviet traffic during and after the Second World War, the perfect cipher has been broken.

Why it matters

This is the lesson Kahn's book teaches most reliably to engineers. A system is only as secure as its use. Good design reduces the opportunities for human error, by making correct use easy and incorrect use difficult. Kerckhoffs saw this in the nineteenth century, and modern designers rediscover it constantly.

The arms race between makers and breakers

The seventh key idea is that the history of cryptology is a contest in which each advance on one side provokes an advance on the other. Kahn shows this pattern across the whole span of his history.

The cycle

Simple substitution was defeated by frequency analysis. Cipher-makers responded with nomenclators, homophones and nulls. Codebreakers learned to handle these. Polyalphabetic ciphers seemed to settle the matter for centuries, until Kasiski and Babbage found their weakness. The telegraph and radio created new demands for speed, which produced new field systems, which in turn were broken. Cipher machines with rotating wired wheels appeared after the First World War, producing enormously long and complex polyalphabetic sequences. Codebreakers, using statistics and, eventually, machines of their own, broke many of them.

Machines against machines

The rotor machine was one of the great inventions of the twentieth century's cryptography. Kahn describes several inventors who arrived at the idea independently around the same time, including Edward Hebern in the United States. A rotor is a wheel with electrical contacts on both faces, wired so that each input letter leads to a different output letter. Several rotors in a row, each stepping forward after a letter, produce a cipher that changes with every keystroke and repeats only after a very long period. The German Enigma and the American SIGABA were rotor machines; so, in a different design, was the Japanese machine the Americans called Purple.

Breaking such machines required new tools: mathematical analysis of their structure, statistical attacks on their output, and electromechanical devices that could test many possible settings quickly. These devices were among the ancestors of the electronic computer. Kahn could only hint at the full story of this development because so much of it was still secret.

Is the contest ever settled?

Kahn's history suggests that no advantage lasts forever. But the 1996 chapter on public-key cryptography raises the possibility that the balance has shifted. Modern ciphers, designed using deep mathematics and published for open analysis, may be strong enough that the mathematics will hold for practical purposes. If so, the contest moves away from the cipher itself to the edges: keys, software, hardware, people. That is consistent with the sixth key idea, and it is broadly the view of modern security engineering.

What this is often confused with

The arms-race picture is sometimes taken to mean that every cipher is eventually broken. That is not quite what the history shows. The one-time pad, used correctly, has never been broken. Some modern systems have resisted all known attacks for decades. What the history shows is that confidence in a cipher's strength has often been misplaced, and that people who believed their systems unbreakable were frequently the easiest targets.

Intelligence becomes an industry

The eighth key idea is that in the twentieth century communications intelligence grew from a small specialist craft into a vast state enterprise. Kahn traces this growth and gives one of the first public accounts of its largest product, the American National Security Agency.

From a room to a city

In the First World War, a codebreaking office might have dozens of people. By the end of the Second World War, the British and American efforts employed many thousands. After the war, these efforts were consolidated rather than dismantled. The United States created the National Security Agency in 1952, and it grew into an organisation with very large numbers of employees, huge computing resources and listening posts around the world. Its existence was barely acknowledged for years.

Kahn describes the agency's structure, its interception of foreign communications, its codemaking for American use, and its recruitment and secrecy. He also describes the defection of two of its mathematicians to the Soviet Union in 1960, the event that first prompted his own interest in writing the book. His account was compiled from public sources and interviews and is necessarily incomplete, but for many readers it was the first glimpse of an institution of great power.

Traffic analysis

Kahn explains that even when messages cannot be read, much can be learned from their patterns. Who is sending to whom, how often, from where and at what times can reveal the structure of an organisation, the movement of forces and the approach of an operation. This practice, called traffic analysis, is an early form of what is now called metadata analysis. Kahn's account shows that it was already a major source of intelligence long before computers made it easy.

Why it matters

The industrialisation of intelligence changed the relationship between states and their citizens as well as between states. An agency built to read foreign communications has the technical ability to read domestic ones. Kahn writes in a period before the great public controversies over surveillance, but he is aware of the issue. His book helped begin the public conversation about the place of such agencies in a democracy.

Codes, ciphers and the anatomy of secrecy

Alongside its history, the book teaches the reader how secret writing works. Kahn's thematic chapters are a gentle course in the subject, and they deserve attention as a key part of what the book offers.

Codes and ciphers

Kahn draws the basic distinction clearly. A code works on units of meaning: words, phrases or whole sentences are replaced by code groups taken from a codebook. A cipher works on units of writing: individual letters or small groups of letters are transformed according to a rule and a key. Codes are bulky and hard to change, since a new codebook must be printed and distributed. Ciphers are compact and can be changed by changing the key. Much of the history concerns the shift from codes toward ciphers, and the use of both together, as when a coded message is then enciphered for extra protection.

Substitution and transposition

Ciphers in turn come in two main families. Substitution replaces each letter with another symbol. Transposition rearranges the order of the letters without changing them. The Spartan staff was a transposition. Caesar's cipher, shifting each letter a fixed number of places along the alphabet, was a substitution. Strong systems often combine the two.

Language and decipherment

Kahn devotes attention to the relation between cryptology and linguistics. Breaking a cipher depends on knowing the statistical structure of the language. Conversely, the methods of cryptanalysis have been used to decipher lost scripts. Kahn discusses the decipherment of ancient writing systems, such as Egyptian hieroglyphics and the Mycenaean script known as Linear B, as related achievements, in which researchers worked from patterns in unknown texts toward the language beneath them.

Puzzles and pretenders

Kahn also covers the stranger corners of the subject. He discusses manuscripts whose script has never been read, ciphers said to conceal buried treasure, and the long tradition of claims that famous literary works contain hidden messages revealing their true author. He shows how William and Elizebeth Friedman examined claims of hidden ciphers in Shakespeare and found them baseless. The lesson is a useful one for any reader: the human mind is very good at finding patterns, and without rigorous method it will find them where none exist.

Messages to the stars

Finally, Kahn considers how one might design a message to be understood by intelligent beings with whom we share no language. This is cryptanalysis in reverse: making a message that wants to be broken. It shows how far the logic of the subject reaches, from tomb walls to radio telescopes.

The public-key revolution

The 1996 edition added a final chapter on the most important development in cryptography since the book first appeared. It deserves a place among the key ideas because it changed the nature of the subject, and because it is the bridge from Kahn's history to the digital world.

The key distribution problem

Every system in Kahn's main history shares one requirement. Sender and receiver must share a secret key in advance. Armies printed and distributed codebooks; diplomats carried keys in sealed pouches; spies were given one-time pads. Distributing keys was costly, slow and dangerous, and captured keys were the source of many of the great codebreaking successes. As long as this requirement held, secure communication between strangers was impossible.

Two keys instead of one

In the mid-1970s, Whitfield Diffie and Martin Hellman published a method by which two parties could agree on a shared secret over an open channel, with an eavesdropper hearing everything and still unable to work out the secret. They also proposed the idea of a public-key system, in which each person has two keys: a public one that anyone can use to encrypt a message to them, and a private one that only they hold and that decrypts it. Soon afterwards, Ronald Rivest, Adi Shamir and Leonard Adleman found a practical way to do this, based on the difficulty of factoring large numbers. It became known by their initials, RSA. It later emerged that researchers at a British government agency had found similar ideas a few years earlier and kept them secret.

An analogy is often used. Imagine a box with a padlock that anyone can snap shut, but only the owner can open. The owner hands out open padlocks freely. Anyone can put a message in a box, snap a padlock on and send it. Only the owner, with the one key, can open it. No secret had to be shared in advance.

Signatures

Public-key methods also made digital signatures possible. A person can use their private key to produce a value attached to a message that anyone can check with the public key, proving that the message came from that person and was not altered. This turned cryptography from a tool for secrecy into a tool for authentication and trust. Secure websites, software updates, electronic payments and blockchains all depend on it.

Why it matters

Public-key cryptography took the subject out of the exclusive hands of states. For most of Kahn's history, strong cryptography was a government monopoly, and the great codebreaking organisations were state agencies. After the public-key revolution, strong encryption became available to anyone with a computer. This led to the political struggles of the 1990s over whether governments should be able to restrict or bypass encryption. Kahn's added chapter touches on these. The full story is told in other books on this shelf.

What did not change

It is worth noticing what public-key cryptography left untouched. The private key must still be kept secret, and losing it, or having it stolen, is as fatal as losing a codebook was in 1917. Software that implements the mathematics can contain errors. People can still be tricked into trusting the wrong public key, much as diplomats were once fooled by forged documents. In other words, the human-edge lesson of Kahn's main history survives the revolution intact. The locks became far stronger; the doors, the keys and the people who hold them remained where the danger lies.

The arrival of computers also changed codebreaking. Searching through enormous numbers of possible keys, which once required rooms of machines or teams of clerks, became routine. This is why modern ciphers use keys so long that even the fastest computers could not try them all. The contest Kahn describes continues, but its arithmetic is now measured in quantities far beyond anything his earlier characters could imagine.

The tradition around it

Before Kahn, the main popular account in English was Fletcher Pratt's Secret and Urgent, the book that first drew Kahn to the subject. There were also technical works by practitioners such as Friedman and Parker Hitt, and memoirs such as Yardley's. Kahn absorbed all of these and replaced them. His book became the reference against which later histories were measured.

After The Codebreakers, the revelation in the 1970s of the British breaking of Enigma launched a large literature on Bletchley Park and the Ultra secret, which fills the main gap in Kahn's account. Kahn himself contributed to it with Seizing the Enigma. Later histories have drawn on declassified files that were not available to him, including records of Soviet codebreaking and of American work during the Cold War.

On this shelf, Simon Singh's The Code Book is the most natural companion. Written in 1999 for a general audience, it covers much of the same history in far fewer pages, includes the Enigma story Kahn could not tell, and carries the account into public-key cryptography and the beginnings of quantum cryptography. Many readers will find it the best way in before tackling Kahn. Steven Levy's Crypto tells the story of the public-key revolution and the political battles that followed, picking up where Kahn's 1996 chapter leaves off.

For the technical side, Bruce Schneier's Applied Cryptography and Ferguson, Schneier and Kohno's Cryptography Engineering describe modern systems and the engineering principles that keep them secure, including the human-edge lessons Kahn's history teaches. Katz and Lindell's Introduction to Modern Cryptography, Koblitz's A Course in Number Theory and Cryptography, Aumasson's Serious Cryptography and the Handbook of Applied Cryptography by Menezes, van Oorschot and Vanstone give the mathematics behind the systems Kahn could only describe.

The blockchain books in the bay, such as Antonopoulos's Mastering Bitcoin and Narayanan and colleagues' Bitcoin and Cryptocurrency Technologies, depend on public-key signatures and cryptographic hashing. They are the latest chapter of the story Kahn began. Andy Greenberg's This Machine Kills Secrets carries the theme of secrecy and its makers into the age of leaks and anonymity networks.

Questions and criticisms

What has aged

The most obvious weakness is the Enigma gap. A reader of Kahn alone would badly underestimate the role of British and Polish codebreaking in the Second World War, and the importance of the early computing machines built to support it. The 1996 revision did not rewrite the wartime chapters to include this material. Readers should treat the book's account of the European war as incomplete.

Some of Kahn's attributions of origin have also been revised. The discovery of al-Kindi's treatise, mentioned above, pushed back the origin of frequency analysis. Research in archives in many countries has added detail and sometimes corrected particular stories. The book's account of the National Security Agency, built from public sources in the 1960s, has been far surpassed by later revelations and declassified histories.

Some individual stories in the book have also been complicated by later work. Historians with access to fuller archives have sometimes given more credit to people Kahn mentions only briefly, or less to those he celebrates. This is the normal fate of a pioneering history, and it does not diminish the book. It simply means that a reader interested in a particular episode should check a more recent specialised account.

Breadth and depth

The book's enormous scope comes at a cost. It is long, sometimes discursive, and uneven: some periods and countries receive lavish treatment while others are covered briefly. Kahn's focus is heavily on Europe and the United States in the modern period. His coverage of non-Western traditions, though pioneering for its time, is thin by later standards.

Technique and mathematics

Kahn explains classical techniques well, but the mathematical foundations of modern cryptography, which matter enormously after the 1970s, are beyond the book's scope. Readers interested in how modern ciphers work must turn to other books.

Attitude to secrecy

Some readers find Kahn too admiring of intelligence agencies, others too willing to reveal their methods. In the 1960s, officials worried that the book would help foreign governments improve their security. Later critics worried that it did not ask hard enough questions about surveillance. Kahn's position was that of a historian who believed that a democracy should know the general outline of what its secret institutions do, while respecting legitimate secrets.

What has held up

The book's central lessons have held up remarkably well. The universality of secret writing, the founding role of frequency analysis, the decisive influence of codebreaking on war, the primacy of human error, and the endless contest between makers and breakers are all confirmed by later research. The book remains the fullest single-volume history, and most later works still build on it.

Why it is on this shelf

This book is on the shelf because every system that relies on cryptography today, from a secure message to a blockchain ledger, stands at the end of the long history it tells. Understanding that history makes clear what cryptography can and cannot do. Mathematics can make a cipher strong. It cannot make the people who use it careful.

For a reader of economics, the book is a study in information as a source of power and advantage. Who knows what, and who knows that others know, decides negotiations, markets and wars. For a reader of technology, it is a long case study in security engineering, showing how systems fail at their edges. For a reader of science, it shows statistics and linguistics turned into practical tools of extraordinary consequence.

For a reader of Vedanta and of the Indian traditions more broadly, there is a quieter resonance. Indian thought has long considered the relation between a surface form and a hidden meaning, and the need for a qualified reader to unlock a text. Kahn notes that classical Indian texts treated secret writing as one of the cultivated arts. For a reader of Jyotish, the book's long story of pattern-finding is a reminder of both the power and the danger of seeing structure in data: the codebreaker's rigour and the crank's illusions come from the same human faculty, and only method separates them.

How to read it

The book is very long. Few readers will read it straight through, and there is no need to. It rewards selective reading, guided by interest, with a return to the whole over time.

A first pass

  • Read the opening chapter on Pearl Harbor to feel the stakes and see Kahn's narrative method at its best.
  • Then read the chapters on the ancient world, the Arab founders of cryptanalysis and the Renaissance. These give the conceptual foundations: substitution, frequency analysis, polyalphabetic ciphers.
  • Read the account of the First World War, especially the Zimmermann telegram.
  • Read the Pacific war chapters, especially Midway.
  • If you have the 1996 edition, read the final chapter on public-key cryptography.

With a pencil

  • Take a short paragraph of English, encipher it with a simple substitution, and give it to a friend to break with frequency analysis. Then reverse roles.
  • Encipher a message with a repeating keyword of five letters, then find repeated sequences in the cipher text and measure the distances between them. You will see why the keyword's length is revealed.
  • Make a list of all the human errors Kahn mentions in the wartime chapters, and sort them into types. Then ask which of them modern systems still suffer from.

What to skip on a first pass

The chapters on amateur ciphers, literary claims and unsolved puzzles are entertaining but can wait. The detailed accounts of national codebreaking services in the interwar years can be skimmed. The account of the National Security Agency is of historical interest but outdated, and can be read later alongside more recent sources.

What to read next from this shelf

Read Simon Singh's The Code Book for the Enigma story and a compact retelling of the classical history. Then read Steven Levy's Crypto for the public-key revolution and its politics. For how modern systems are built and why they fail, read Ferguson, Schneier and Kohno's Cryptography Engineering. For the mathematics, Katz and Lindell's Introduction to Modern Cryptography. For where these ideas lead today, read Mastering Bitcoin.

Questions to carry

  • Why does secret writing appear in so many unrelated civilisations?
  • What is the difference between hiding a message and making it unreadable, and why did the second win out?
  • Why did frequency analysis first appear in the Arab world, and what does that say about how breakthroughs happen?
  • Why did professional codebreaking first develop in Renaissance diplomacy?
  • Why was the repeating-keyword cipher considered unbreakable for so long, and what was its weakness?
  • What does Kerckhoffs' principle demand, and why is it still followed?
  • Why must a codebreaker sometimes hide a triumph?
  • At Pearl Harbor, why was reading the enemy's messages not enough?
  • Why do strong ciphers so often fail through human error?
  • Why is the one-time pad perfect in theory and difficult in practice?
  • What can be learned from the pattern of messages without reading their content?
  • Does public-key cryptography end the contest between makers and breakers, or move it elsewhere?
  • What is lost when strong cryptography is held only by states, and what is risked when it is held by everyone?
  • Where in your own systems is the key under the mat?

Words to know

  • Cryptology: the science of secret communication, including both making and breaking secret systems.
  • Cryptography: the making of codes and ciphers.
  • Cryptanalysis: the breaking of codes and ciphers without being given the key.
  • Steganography: hiding the existence of a message, as with invisible ink.
  • Plaintext: the original readable message.
  • Ciphertext: the message after encryption.
  • Key: the secret information that controls how a particular message is enciphered and deciphered.
  • Code: a system that replaces words or phrases with code groups from a codebook.
  • Cipher: a system that transforms individual letters or small groups of letters according to a rule and a key.
  • Substitution: replacing each letter with another symbol.
  • Transposition: rearranging the order of letters without changing them.
  • Nomenclator: a combined cipher alphabet and list of code words, the standard diplomatic system of early modern Europe.
  • Frequency analysis: breaking a cipher by comparing how often its symbols occur with how often letters occur in the language.
  • Polyalphabetic cipher: a cipher that switches among several substitution alphabets during a message.
  • Black chamber: a secret office that intercepted, opened and decoded diplomatic mail.
  • Crib: a guessed piece of plaintext used to help break a cipher.
  • Index of coincidence: a statistical measure of how likely two letters chosen at random from a text are to be the same, used to analyse ciphers.
  • Rotor machine: a cipher machine using wired rotating wheels to produce a changing substitution with each letter.
  • One-time pad: a cipher using a random key as long as the message and never reused; unbreakable if used correctly.
  • Kerckhoffs' principle: a system should remain secure even if everything about it except the key is known.
  • Traffic analysis: learning from the pattern of communications, such as who sends to whom and when, without reading content.
  • Communications intelligence: intelligence gained from intercepting and analysing an opponent's communications.
  • Public-key cryptography: a system in which each person has a public key for encryption and a private key for decryption, removing the need to share a secret in advance.
  • Digital signature: a value computed with a private key that proves who sent a message and that it was not altered.

A note on this edition

This is a study edition written for this shelf in our own words. It describes and explains The Codebreakers but does not reproduce it. The book itself is in copyright, and it is a great and generous work that no summary can replace. Find it in a library or bookshop and read the parts that call to you, then return for more.

Terms from this book with their own page: Public-key cryptography, Digital signature

More from “Cryptography, blockchain and crypto”

The whole section →