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. In the 1920s through the 1940s, Germany used the Enigma machine to hide secret messages. If you typed the letter "A," electricity shot through a shifting maze of wires and lit up a totally different letter, like "G."

The secret was inside three spinning wheels called rotors. Every single time you pressed a key, the first rotor clicked forward, completely changing the maze. Press "A" three times, and it might light up as "G," then "P," then "W."

Who could solve a puzzle with billions of changing answers? A team of brilliant Polish mathematicians, including Marian Rejewski, mapped the Enigma's wiring in 1932. In 1938, they built a clacking electro-mechanical machine called the bomba to track the moving maze.

When World War II erupted, an ultra-secret team of British code-breakers at Bletchley Park took the baton. Mathematicians like Alan Turing and Gordon Welchman built a massive, improved machine called the Bombe to test thousands of rotor positions at once.

By searching for a "crib"—a guessed word, like "WEATHER"—the Bombe could sniff out the exact daily setting. This incredible international teamwork unraveled Germany’s deepest secrets and helped end the war.

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 Code That Was Never Broken

Codes at War · Code Talkers

During World War II, the U.S. Marine Corps needed a code the enemy couldn't crack. They found their answer in a brilliant group of young Navajo men. These Marines used their deeply complex, unwritten native language to build the only military code in modern history that was never broken.

The code talkers built a brilliant two-layer puzzle. The first layer was a clever alphabet. To spell out English names, they used Navajo words. For example, the letter A was "ant" and B was "bear." To spell the name Bob, they would simply say "Bear-Owl-Bear" over the radio.

The second layer was a secret dictionary of over 400 military words. A submarine became an "iron fish." A fast fighter plane became a "hummingbird." The enemy could easily listen to the radio, but all they heard were highly confusing sentences about bears, ants, and hummingbirds.

While machines took hours to unscramble messages, the Navajo code talkers could translate and send a top-secret battle command in just two and a half minutes. Thanks to their linguistic genius, thousands of lives were saved.

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

Imagine trying to send a text message using only a flashlight or a single radio beep. That is the genius of Morse code. It translates the entire alphabet into a rhythmic language of short signals (dots) and long signals (dashes). To keep things fast, the most common letters are shortest. "E" is just one dot!

You can send Morse code over a telegraph wire, blink it with your eyes, or flash it with a lamp. The secret to making it work is timing. A dash is exactly three times as long as a dot, and silent pauses tell the listener when letters and words end.

The most famous Morse code message in history is SOS. You have probably heard that this stands for "Save Our Souls" or "Save Our Ship." Surprisingly, that is a complete myth! Those letters don't stand for any words at all. They were chosen purely for the way they sound.

In Morse code, an "S" is three dots and an "O" is three dashes. Put together, they make an unmistakable, urgent rhythm that pierces right through crackling radio static. Check out the demo chart next to this page to see the whole alphabet—and try tapping out your own name!

Dots and Dashes
Morse code
A●▬B▬●●●C▬●▬●D▬●●EF●●▬●G▬▬●H●●●●I●●J●▬▬▬K▬●▬L●▬●●M▬▬N▬●O▬▬▬P●▬▬●Q▬▬●▬R●▬●S●●●TU●●▬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.

### Secrets in the Pigpen

Codes at War · Pigpen

In the eighteenth century, a secretive group called the Freemasons needed a way to keep their messages hidden. Later, Union prisoners of war during the American Civil War used the exact same trick. Instead of swapping letters for other letters, they swapped letters for pictures.

To use the pigpen cipher, you draw four grids. The first two look like big tic-tac-toe boards, and the second two look like giant X's. You drop the alphabet into the empty spaces of these grids, adding a single dot to every space in the second board and the second X.

Here is the trick: every letter becomes the shape of the "fence" around it. To write a secret message, you just draw the lines that surround your letter. If your letter lives in a dotted grid, you draw the fence and put a dot inside it.

Check out the demo grids next to this story to see how the alphabet fits inside the pens. A codebreaker just draws the blank grids, matches the shapes to the letters, and reads the hidden word!

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.

### The War of Waving Flags

Codes at War · Signals

During the Civil War, communicating across a smoky battlefield was a nightmare. U.S. Army surgeon Major Albert Myer solved this by inventing the "wig-wag" system. Signalmen waved massive flags by day and flaming torches by night. Waving left meant "1," waving right meant "2," and combinations spelled out letters.

There was just one massive problem. Myer’s brilliant assistant, E. Porter Alexander, joined the Confederate Army, while Myer fought for the Union. Both sides were using the exact same system! To stop enemies from reading their flags through spyglasses, signalmen used brass cipher disks to scramble the alphabet.

Telegraph wires weren't safe either. Enemy spies frequently climbed poles to hook their own listening gadgets directly to the cables. To protect President Abraham Lincoln’s military telegrams, the Union Army relied on a low-tech but brilliant trick called a Route Cipher.

Instead of swapping individual letters, a Route Cipher scrambles entire words. A commander wrote a message into a grid, replaced important names with fake code words, and read down the columns instead of across the rows. Anyone tapping the wire just heard a confusing jumble of out-of-order nonsense.

### Secrets the Size of a Sand Grain

Codes at War · Hidden

Most secret codes work by scrambling a message so the enemy can't read it. But what if you hide the fact that there is a message at all? This trick is called steganography. If an enemy spy doesn't know a secret exists, they won't even try to crack it.

Movies make invisible ink look easy—just write in lemon juice and hold it over a candle! But during World War II, military censors easily busted lemon-juice spies by swabbing mail with chemical detectors. Real secret agents had to wear surgical gloves and use complex formulas that dried perfectly clear.

The ultimate hiding spot was the microdot. Perfected by German spies, an agent would type a full page of intelligence, photograph it, and use special lenses to shrink the image down to one millimeter—the size of a single grain of sand.

They printed this tiny photo on clear film, punched it out, and glued it perfectly over the period at the end of a sentence in a completely normal letter. Censors scanning the mail saw nothing but friendly chatter, missing the massive secret sitting in plain sight.