Code Girls: The Untold Story of the American Women Code Breakers Who Helped Win World War II

Every code breaker had his or her method of coping with frustration. Frank Rowlett liked to go to bed early, then wake up in the middle of the night and see if inspiration struck him. William Friedman often thought of solutions while shaving; he was a big believer in the problem-solving power of the subconscious. Genevieve Grotjan was one of the most patient team members. She would sit for hours contemplating streams of letters, making notations, creating charts.

William Friedman had taught his students that if you scrutinize a cipher long enough, from as many angles as possible, a pattern must declare itself. The goal of any code maker is to come up with a system that is random and therefore unbreakable. But this is a hard thing to do. Most machines used switches or rotors—set in new orders each day or couple of days, according to the key or setting—to transform one letter into another, often several times, so that A might become D, and then P, and emerge as, say, X. The next time, the same letter would follow a whole new path. But wheels and rotors will eventually work through an entire cycle; at a certain point, they will come back to the beginning and encipher the same letter the same way. A will again become D, and then P, and then X. The more elaborate the mechanism—the more wheels involved, the more complex the settings—the longer the interval before the repetition occurs. But at some point, something, somewhere, will repeat.

What Friedman also understood, and managed to teach his team, was that there are mathematical ways of detecting the underlying behavior not only of language but also of individual letters. In English, E is the most frequent letter. If you are making a cipher and turn every E in a message into a Z, then Z will behave exactly as E does: It will become the most frequent letter. One of the first things a cryptanalyst does is take a “frequency count” of all the letters in an enciphered message. If Z appears most frequently, this likely means Z stands for E. Ciphers quickly get much, much trickier, but statistical methods always help. It’s remarkable what can be done with math.

What Friedman had also taught them during their training is that you can break a foreign cipher without understanding the language, as long as you know how the letters in that language behave. Certain letters, like S, often travel alongside certain other letters, like T, and he taught his staff to count how many times certain pairs—digraphs—appeared together, as well as trigraphs like ing or ent or ive or tetragraphs like tion. He knew on average how many vowels—between thirty-three and forty-seven—typically appear in one hundred letters of plain English. He knew which letters rarely appear side by side. He had even figured out how many blanks—or letters not occurring—tend to appear in one hundred letters. He had identified which consonants (D, T, N, R, S) are most frequent in ordinary English and which are least frequent (J, K, Q, X, Z). He studied how French letters behaved (common digraphs: es, le, de, re, en, on, nt) and how English behaved when sent over the telegraph. Since “the” is often omitted from a telegraphed message, the statistical behavior of E changes slightly in a telegram. These are the kinds of nuances—random variations, standard deviations—that statisticians live and breathe for.

Over a span of months, the code breakers had come up with every attack on Purple that they could think of. They had mastered the behavior of romanized Japanese, in which pairs of vowels often occurred, such as oo, uu, ai, ei, and they knew that Y almost always was followed by O or U, often doubled, as in ryoo, ryuu, kyoo, and kyuu. They reviewed the workings of known machines on the Western market, in case the Japanese had borrowed ideas from them. Among these was the Kryha, a noisy thing with a gear-like mechanism that resembled clockwork; something they called the “Damm machine,” an easily penetrated contraption named after its inventor, a Swedish engineer named Arvid Damm; and those invented by the horse thief Hebern. All used devices that could take a letter and turn it into another letter. Some advanced step by step. Some would skip forward several letters, or skip once and then not skip the next time. When the Purple machine was being installed in Japanese embassies, Friedman’s team was able to follow the itinerary of the installer—a Japanese expert identified in memos only as Okamoto, who traveled city by city putting in the new machines—by reading updates he sent back to Tokyo over the old Red system. They kept hoping he would use Red to send home a report, some kind of clue as to what the Purple machine was and how it worked. Alas, Okamoto did not.

Friedman’s team was under enormous pressure. When Purple first came online, they thought they could break the machine in a matter of months. As 1940 progressed and Jews in Europe were rounded up, more concentration camps opened, the blitzkrieg advanced, Roosevelt was anxious to know whether Japan would join in a formal alliance with the Axis powers of Germany and Italy, and if so, what the terms might look like. Emissaries from military intelligence visited Friedman every day, nudging him, filling him with anxiety, asking whether he was doing everything he could. The code breakers talked to radio intercept operators in the field, urging them to ensure that the circuits carrying Purple messages were fully covered. They set up more IBM machines—tabulators that could count and sort very fast—that had been modified to sort the Purple messages they were getting. And still: nothing.

Friedman liked his team to do their own pen work—copying out each letter—so as to have a palpable, physical connection with the cipher. One technique was to write out the text of an enciphered message and print above or below it something they called a “crib.” Cribbing is an essential component of code breaking—perhaps the essential component. Cribs are educated guesses about what the message says, or even what just a word or phrase probably consists of. Some minor Japanese ministries and embassies were still using the old Red machines, and sometimes Tokyo would send a message to all embassies—known as a circular—using both Red and Purple. Circulars were a great source of cribs. The code breakers could decipher the Red version and set it against the Purple cipher, hunting for correlations.

Liza Mundy's books