← Top Secret
Chapter 2

Codes at War

When countries fight, secrets win. This chapter is packed with the most famous codes in history — a machine that scrambled a message billions of ways, a code built from a language, dots and dashes flying through the air, and letters hidden inside little fences.

This chapter teaches pigpen and Morse code.

### The Typewriter That Lied

Codes at War · Enigma

Imagine a typewriter that lies to you. During World War II, the German military used a cipher machine called the Enigma, invented by engineer Artur Scherbius. When an operator pressed a letter key, electricity zipped through a plugboard that swapped pairs of letters, then through three spinning wheels called rotors, bounced off a reflector, and lit up a bulb under a completely different letter.

The wildest part? Every single time you pressed a key, the first rotor clicked forward, changing the electrical maze inside. Press the same letter three times in a row, and three different letters would light up. Without knowing the exact starting setup of the wires and rotors, a spy intercepted nothing but gibberish.

Movies often show British mathematician Alan Turing cracking the Enigma all by himself, but real codebreaking is a team sport. Starting in 1932, three brilliant Polish mathematicians—Marian Rejewski, Henryk Zygalski, and Jerzy Rozycki—used pure math to map the Enigma's secret wiring. In 1938, Rejewski built an electro-mechanical code-breaker called the bomba.

Just before World War II began, the Polish team shared their breakthroughs with the British. At a secret headquarters in England called Bletchley Park, Turing, Gordon Welchman, and a massive team built an even bigger machine called the Bombe. By taking a guessed word—like "WEATHER"—and testing 36 Enigma setups at once, they cracked the "unbreakable" code.

A cozy code-breaking room at midnight: a clever team huddles around a boxy machine with rows of round glowing keys and little lit lamps and gears and rotors turning inside; teacups, stacks of paper, and a big blackboard of chalk marks surround them, everyone leaning in with delighted we-cracked-it faces, lit by cyan and violet glow.

Cracking the Enigma at Bletchley Park — England, 1940s.

### The Unbreakable Voice of the Marines

Codes at War · Code Talkers

In 1942, the United States Marine Corps needed a fast, unbreakable battlefield code for the Pacific Theater. World War I veteran Philip Johnston suggested an ingenious solution: the Navajo language. Deeply complex, tonal, and unwritten, it was nearly impossible for non-speakers to mimic. At Camp Elliott near San Diego, 29 Navajo Marine recruits stepped up to build it.

They did not just chat in their native tongue—they engineered a brilliant two-layer cipher inside it. First, to spell out English words, they chose Navajo words for each letter of the alphabet, like wo-la-chee (ant) for A and shush (bear) for B. Second, they invented a secret dictionary of over 400 military terms.

In this code, a fighter plane became a "hummingbird" (da-ha-tih-hi) and a submarine was an "iron fish" (besh-lo). Even an outside Navajo speaker listening to the radio would only hear baffling sentences about ants, bears, and hummingbirds. Memorizing every word so nothing could be captured on paper, about 400 Navajo Code Talkers served—and Japanese cryptanalysts never broke a single message.

Two proud Marine radio operators crouch in tall grass with a field radio and a long antenna; one speaks into a handset while the other gives a thumbs-up, and gentle sound-wave rings ripple out of the radio into a starry indigo sky. Warm and heroic, no battle — just two friends sending a secret only they understand.

The Navajo code talkers send a code no enemy ever broke — 1940s.

### Talking in Dots and Dashes

Codes at War · Morse

How do you send a message when no one can hear your voice? Standardized internationally in 1865, Morse code solves this by turning every letter of the alphabet into a rhythm of short signals called dots (or dits) and long signals called dashes (or dahs).

Because it relies purely on timing, Morse code can travel down a telegraph wire, beep over a radio, flash from a lamp, or even be blinked with your eyes. To keep messages fast, common letters get the shortest patterns: E is just one dot, and T is a single dash.

The secret to reading Morse is counting the silence. A dash lasts three times as long as a dot. You leave a one-dot pause between signals inside a single letter, a three-dot pause between letters, and a seven-dot pause between words.

That steady beat gave the world its most famous distress call: SOS. Adopted in Germany in 1905 and made a worldwide rule in 1908, SOS does not actually stand for Save Our Ship or Save Our Souls! Officials chose three dots, three dashes, and three dots strictly because that unmistakable rhythm pierces right through noisy radio static. Check out the full Morse chart in the demo panel and try tapping out a message yourself.

Dots and Dashes
Morse code
A●▬B▬●●●C▬●▬●D▬●●E●F●●▬●G▬▬●H●●●●I●●J●▬▬▬K▬●▬L●▬●●M▬▬N▬●O▬▬▬P●▬▬●Q▬▬●▬R●▬●S●●●T▬U●●▬V●●●▬W●▬▬X▬●●▬Y▬●▬▬Z▬▬●●0▬▬▬▬▬1●▬▬▬▬2●●▬▬▬3●●●▬▬4●●●●▬5●●●●●6▬●●●●7▬▬●●●8▬▬▬●●9▬▬▬▬●
message
SEND HELP NOW
secret
●●● ● ▬● ▬●● / ●●●● ● ●▬●● ●▬▬● / ▬● ▬▬▬ ●▬▬
Every letter is a pattern of short and long signals. Read the chart, then read the message.

### Letters in Little Pens

Codes at War · Pigpen

Most ciphers swap one letter for another. The Pigpen cipher swaps letters for tiny geometric pictures. In the 1700s, members of a secretive society called the Freemasons used it to guard their private lodge letters and even carved the mysterious symbols onto gravestones.

A century later, during the American Civil War, Union soldiers trapped in Confederate prison camps used the exact same code to smuggle secret notes past their guards. When you don't have a fancy coding machine, a pencil and a scrap of paper can still outsmart an army.

Here is the secret: you draw two tic-tac-toe boards and two giant X's, then drop the alphabet into the spaces. Each space is a little "pigpen" for the letter inside.

To write a message, you don't write the letter at all—you just draw the shape of the fence lines surrounding its cell! Because two tic-tac-toe boards and two X's look alike, letters in the second tic-tac-toe board and second X get a dot inside their fence. Check out the demo grids to see how every letter gets its own pen.

The Pigpen Cipher
Pigpen key
ABCDEFGHIA–IJKLMNOPQRJ–R + dotSTUVS–VWXYZW–Z + dot
message
SECRET CLUB
secret
SECRETCLUB
Each letter lives in its own little pen. Draw the fence around it, and add a dot for the second set.
By warm candlelight a curious kid in an old-timey vest draws a tic-tac-toe grid and an X grid on parchment and slots letters into the little pens; around them, ghostly glowing fence-shapes float up off the page like puzzle pieces; a quill, an inkpot, and a magnifying glass rest nearby.
Drawing the pigpen pens by candlelight.

### Waving Flags and Scrambled Words

Codes at War · Signals

How do you send a text message across a smoky Civil War battlefield? You wave a giant flag. In the 1850s, U.S. Army surgeon Major Albert Myer and his assistant, Lieutenant E. Porter Alexander, invented wig-wag signaling. Signalmen stood on high ridges waving flags by day and flaming torches by night.

The code was brilliantly simple. Holding the pole straight up was the starting mark. Swooshing it left meant one, and swooshing it right meant two. Every letter was a combination of ones and twos. Because enemy lookouts could easily watch the flags from miles away, signalmen used two spinning brass circles—a cipher disk—to scramble the letters first.

Telegraph wires were not safe either, because spies routinely hooked their own listening devices right onto the lines. To protect President Abraham Lincoln's military telegrams, the Union used Stager's Route Cipher. Clerks wrote a message into a grid, swapped important words for fake code words, and read down the columns instead of across the rows.

If a spy tapped the wire, the telegram sounded like total nonsense. Only a receiver who knew the exact size of the grid and the secret up-and-down route could put the words back in order.

### Hiding in Plain Sight

Codes at War · Hidden

Most codes scramble a message so the enemy cannot read it. Steganography does something sneakier: it hides the fact that a message exists at all. After all, a codebreaker cannot crack a secret if they never even look for it.

In the Revolutionary War, spies wrote with lemon juice that turned brown when heated over a candle. By World War II, however, mail censors routinely swabbed letters with iodine and ninhydrin to expose basic inks and fingerprints. Wearing surgical gloves, agents had to write with complex chemicals like phenolphthalein, which dried completely clear until brushed with a special chemical reactor.

Even wilder was the microdot, perfected in Germany using the Zapp technique and heavily used by spies like Georg Nicolaus in Latin America during the 1940s. Agents photographed a full page of typed intelligence, then used special lenses to shrink the photo down to a one-millimeter grain of sand.

They punched out this tiny clear film and glued it right over a period at the end of a sentence in a boring, everyday letter. Censors scanning the mail saw nothing but friendly chatter, while a whole page of military secrets sailed right past them.