The Woman Who Smashed Codes
Page 21
These were clandestine circuits, meant to stay invisible, and it became Elizebeth’s goal to pry them out of the dark while remaining invisible herself—an essential part of the job. She knew that if the spies discovered that she was breaking their codes and reading their messages, they would switch to more secure codes, and she wouldn’t know what the spies were saying until she could break the new codes, which might take weeks or months. A spy who speaks in a broken code is “the goose that lays the golden eggs,” as William put it once. If you want to keep gathering the eggs, you must not frighten the goose.
For this reason, Elizebeth’s Cryptanalytic Unit “was probably even more secret than other [codebreaking] organizations,” the NSA concluded after the war, “because it dealt with counterespionage.” Counterespionage, counterintelligence—these are the formal terms for what Elizebeth was beginning to do. She was counterspying on foreign spies, serving as America’s eyes and ears in the invisible world of fascist espionage. Today there are large sections at CIA and FBI that perform foreign counterintelligence, teams of American professionals who spend their days trying to monitor the activities of Russian and Chinese spies, but in 1940 there was almost nothing, and Elizebeth had to act with extreme caution every day. It was essential that her Nazi targets never learn that she existed.
The first few batches of eggs fell smoothly into her basket. As soon as Elizebeth began to analyze the clandestine circuits in 1940, she realized that the spies were relying on different kinds of hand ciphers, variations of tried-and-true methods. Some were familiar systems from the rum days, adulterations of commercial codes like the ABC code and the ACME code. These were solved in a snap. The key for one circuit was found to be 3141592, the first seven digits of the mathematical constant pi. Elizebeth called this circuit “the pie circuit.” Sometimes the Germans sent the key at the start of the message and in groups of three or four letters instead of five, indicating that there was something special about these letters and giving away that they were a key.
When an unfamiliar system was encountered, and nothing was known about the speakers “to provide an entering wedge,” Elizebeth and her teammates tried to start with something small and simple. For instance, if they determined by a routine sort of check that they were dealing with a transposition system, with the letters mixed up instead of swapped out, they would look for common German words in the messages, like zwo, “two,” which is a useful word to a codebreaker because it contains two low-frequency letters, z and w, which makes it stick out more. (The names of numbers were often spelled out in messages to eliminate potential confusion from dropped letters due to radio interference.) Another technique that often helped was to take multiple messages and stack them on top of one another, creating a “depth” of text that made it easier to identify patterns as opposed to analyzing one message at a time:
1
E
A
W
I
Z
T
Z
N
X
O
2
I
E
U
R
Y
R
X
F
E
H
3
U
I
U
H
Z
F
E
N
N
X
Here, Elizebeth was able to look at row 1 and anagram the letters, Scrabble-like, to make the word zwo:
1
Z
W
O
2
X
U
H
3
E
U
X
Now the columns were in a different order, and this new order gave a clue to the structure of the underlying cipher that allowed her to break it.
Essentially, Elizebeth’s goal was to look at these daunting mountains of nonsense and chart a route up the slope in small discrete steps, each of which was like a little game—not quite child’s play but not totally unlike child’s play, either. And the games grew more intricate as the months went on and the coast guard codebreakers followed the intercepts.
Several sets of Nazi spies were using book ciphers similar to the ones that Elizebeth and William had long studied but with new twists. For instance, on January 1, 1940, she received her first intercept from a wireless circuit that linked Mexico with a radio tower in Nauen, Germany. The messages contained only eleven letters of the alphabet: N, R, H, A, D, K, U, C, W, E, and L. One message began
UHHNR
LNDAL
NURND
WCNCK
NRHLN
DNRAN
CHNDR
UNDEN
Relying on intuition and experience, Elizebeth made a few quick assumptions. N was the most frequent letter. She guessed it was being used as a “word separator”—a space bar. She also guessed that because there were only eleven letters in the messages, one of which was a space, the letters must stand for the numbers 0 through 9. But which letters stood for which numbers? If she was correct, the spies might have used a key word to determine that. Elizebeth and her colleagues tried to find the key word by anagramming the eleven letters:
WACKELND RUH
WAHL DRUCKEN
ACH RUND WELK
DA LUNCH WERK
DURCHWALKEN
There it was: Durchwalken, a colloquial German word meaning “to give a good beating.” This was probably the key:
D
U
R
C
H
W
A
L
K
E
N
1
2
3
4
5
6
7
8
9
0
–
Now Elizebeth was able to turn the letters of each message into numbers, using N as the separator:
UHHNR
LNDAL
NURND
WCNCK
NRHLN
DNRAN
CHNDR
UNDEN
2 5 5 - 3
8 - 1 7 8
- 2 3 - 1
6 4 - 4 9
- 3 5 8 -
1 - 3 7 -
4 5 - 1 3
2 - 1 0 -
Cleaning up the numbers, the line became
255-38
178-23
164-49
358-1
37-45
132-10
This looked like a book cipher to Elizebeth; the numbers probably corresponded to locations in some unknown book owned by the spies. After translating the letters of several messages into numbers, she saw that some number combinations appeared more frequently than others: 1-1, 132-10, 343-2, and 65-12. The coast guard codebreakers underlined these frequent combinations, and “after a little experimenting the following was produced”:
65-12
132-10
373-2
301-21
285-25
343-2
B
E
R
L
I
N
65-12
375-2
132-10
321-2
132-10
343-2
B
R
E
M
E
N
BERLIN and BREMEN, two German cities. (In some cases, a letter like R was linked to a few different number combinations.) These frequent letters gave her a start, and when able to solve the code in full, Elizebeth identified the names of two known Nazi agents in Mexico, MAX and GLENN, who would appear in other messages in the future, linked to agents in the United States and South America. The two Nazi spies were reporting to Berlin o
n the movements of U.S. and British ships, making those ships vulnerable to U-boat attacks.
Elizebeth solved their book cipher without needing to see the book and did the same with messages that used other books: The Story of San Michele, the memoirs of a Swedish physician; Soñar la vida, a spy story by a female Mexican fascist; O servo de Deus, a Portuguese novel. One Nazi spy proposed using the 1936 novel Vom Winde Verweht—in English, Blown Away by Wind, i.e., Gone With the Wind—and asked Berlin to locate a copy. Berlin replied that Blown Away by Wind was unavailable in Germany and another book would need to be chosen.
Several Nazi agents, Elizebeth discovered, were using a copy of the romantic novel All This and Heaven Too and a sophisticated process that generated messages full of garbled letters instead of numbers. Each spy had been assigned a unique identification number, such as 7. To encrypt a message, the spy would take that day’s date, add the number of the day and the month to his identification number (for a January 10 message he would add 1 + 10 + 7 = 18) and turn to the resulting page in the novel (page 18). The first words of the first line became part of that day’s key—the key for transforming plaintext words into blocks of nonsense according to a Scrabble-like method that jumbled the letters by stacking them into columns. The rest of the key was taken from the first letters of unindented lines going down the page.
To solve the messages, Elizebeth first had to deduce that All This and Heaven Too was the novel these particular spies had chosen. To do this she went through the same process of reverse engineering that she and William applied in 1917 to solve the Hindu messages. Then she bought her own copy of All This and Heaven Too and kept it on her coast guard desk, allowing her to easily ungarble any new message sent with that system, flipping through the novel and underlining or circling the pieces of the daily keys in red pencil. Here is how she marked up page 15, where the novel’s fictional heroine is deciding whether to become the governess for a hot-tempered Parisian family and move into their home:
Yet she did not dread the thought of entering it. The difficulties t presented would at least be stimulating. One would not erish of boredom in a place where charges of gunpowder might urk in unexpected corners to explode without warning. She felt ddly exhilarated—almost, she thought, as if she were about to tep upon a lighted stage filled with unknown players, to act a ole she had had no chance to rehearse beforehand. She must find he cues for herself and rely on her own resourcefulness to speak he right lines. Henriette Desportes’s heart under the plain gray
Elizebeth wrote the letters of the key horizontally on a piece of graph paper and used it to fill in the German plaintext.
Her basic puzzle-solving style hadn’t changed from the smuggling days, and it remained effective: a process of trial and error with pencil and paper, deduction and experimentation, granules of eraser dust swiped away with a flick of the palm. Her scrap papers still looked like the scrap papers of a person doing the newspaper puzzle page over Sunday-morning tea; she wrote no equations, only numbers and letters grouped and stacked in rows, columns, squares, rectangles, and more exotic shapes. This approach worked for her because over the previous twenty-five years, encountering tens of thousands of messages, Elizebeth had solved so many different kinds of puzzles that she knew how to find shortcuts, to identify patterns in fields of text that were like signatures telling her what to do next. She was a kind of human computer in this sense. Today, if you want a computer to recognize certain patterns, you can train it through a process of “machine learning.” How do you get a computer to recognize a picture of a cloud, for instance? You feed it a lot of pictures and say, essentially, This here is a cloud, and This here is not a cloud. After the computer gains enough “training data,” it’s able to look at a new image, do some math, and say, This is almost certainly a cloud. By 1940, Elizebeth’s brain had probably accumulated more training data about codes and ciphers than any other brain on the planet. She had just seen so many damn clouds. It’s why she was able to make inspired guesses about puzzles. She may not have been writing equations, but she was thinking mathematically.
This is also why, in 1940, when Elizebeth encountered her first Enigma messages from a German Enigma machine, she didn’t feel overly intimidated.
Enigma was a straightforward idea expressed in a diabolical device. In the simplest sense, it was a box that cranked out poly-alphabetic ciphers. Remember the secret messages that eight-year-old Barbara Friedman sent her parents from summer camp? A=B, B=C, C=D. That’s a MASC, a mono-alphabetic substitution cipher. One cipher alphabet encrypts the whole message. Enigma was poly instead of mono, using multiple cipher alphabets per message.
Poly-alphabetic ciphers date to the sixteenth century and can be written by hand with the aid of pre-printed grids of letters or sliding strips of paper. Instead, Enigma did the job with three or more rotating alphabet wheels connected to electrical wires. The wheels lived inside a box with a typewriter keyboard on the outside, the keys arranged in a familiar order, starting with Q W E R T Z U I O. Above the keyboard was a “lampboard” of the same twenty-six letters in the same order. When a writer pressed a key, such as Q, a different letter, perhaps Z, would illuminate on the lampboard—the cipher letter, lit by a small battery-powered bulb. Later, the recipient of the message, operating his own identically configured Enigma, would type Z, and Q would light up, decrypting the message letter by letter.
With each key press, an electrical circuit was completed, and Enigma stepped the right-hand wheel, shifting it one letter forward. Once the wheel stepped through all letters, it stepped the middle wheel by one letter, then the left-hand wheel. The motion was similar to a car odometer—after you drive 9 miles, the right-hand number flips to 0, and the next number to the left flips to 1—and it generated a seemingly random, nonrepeating sequence of 16,900 cipher alphabets before the three wheels returned to their starting positions.
Crucially, no letter could be enciphered as itself. If you pressed j a million times, you would never see j light up on the lampboard.
Although this was a known limitation of the machine, it seemed to pale in comparison with Enigma’s flexibility. The wheels could be arranged in different orders (1-3-2, or 2-3-1), the alphabet rings on the wheels could be set at different starting positions on the wheels, and the starting letter of each wheel, as seen through a small window on the box, was another variable. The choice of variables comprised the machine’s key—the starting configuration used to encrypt all messages on a particular day, week, or month, depending on how often the key was changed.
How many possible keys existed? Depending on the model of Enigma, the number of keys might be as large as 753, 506, 019, 827, 465, 601, 628, 054, 269, 182, 006, 024, 455, 361, 232, 867, 996, 259, 038, 139, 284, 671, 620, 842, 209, 198, 855, 035, 390, 656, 499, 576, 744, 406, 240, 169, 347, 894, 791, 372, 800, 000, 000, 000, 000.
Each one of these keys produced a unique set of 16,900 alphabets before repeating.
All of this seemed to make the job of a codebreaker impossible. There were too many possibilities to comprehend, and then there were possibilities about those possibilities, and possibilities about those possibilities about those possibilities. Clearly, shortcuts had to be discovered, and by the late 1930s, finding these shortcuts—and conquering Enigma—was the biggest problem facing Allied intelligence. After Polish mathematicians made some early breaks into the device, the Germans kept changing its design and how it was used, so the battle over Enigma was ongoing, a cryptologic arms race. The machine had been clunky at first, weighing as much as one hundred pounds, but subsequent versions grew lighter and more compact. The German navy, the Kriegsmarine, first adopted them in 1926 and installed Enigmas in ships and U-boats, followed by other branches of the military, embassies, and intelligence services. In 1936, the Nazis banned all commercial sales of Enigma and began to improve the machine in secret, adding additional components and subtleties intended to make Enigma codes absolutely unbreakable. Different Nazi organizations developed their
own variants. Germany withheld knowledge of these alterations from the enemy, as if Enigma were a submarine or a bomb.
To extract useful intelligence from an Enigma system, Elizebeth Friedman (or anyone else) needed to accomplish two separate and immensely difficult things. First, the machine itself had to be “solved,” its inner workings deduced and mapped—the motions of its wheels and the maze of wires controlling them. This required some leap of human ingenuity, some feat of mathematical deduction or inspired guessing. Then, once the wiring was solved—the part of the system that generally didn’t change—the keys had to be recovered, which changed at different intervals (month, week, day) depending on the practices of different Nazi services. If you found an Enigma key in the morning, you might go to bed at night and get locked out again in your sleep, and the next day you had to find the key again if you wanted to read the new day’s messages.
There were too many Germans using too many Enigmas with too many shifting keys to ever recover the keys by hand, so codebreakers needed to build machines of their own to assault the enemy’s machines, giant electro-mechanical contraptions and some of the first digital computers, too. Automation. Polish codebreakers were the first to solve Enigmas and automate the process of recovering keys. They built “bombes” that mirrored the Enigma rotors, ticking through possible alphabets until they found ones that might fit. Later, the British mathematician Alan Turing discovered how to make bombes dramatically more powerful, based on mathematical principles and previously solved bits of text known as “cribs”—a crib might be the name of a Nazi officer, the time of day, or “Heil Hitler.” His solutions were essentially search algorithms, ancestors of the Internet search algorithms of today. Turing’s biographer calls these “search engines for the keys to the Reich.” It was anti-Nazi Google.