The Man Who Knew Too Much: Alan Turing and the Invention of the Computer (Great Discoveries)
Page 15
Not surprisingly, even at the very end of the war, when Turing and his team were cracking messages right and left, the Germans continued to believe that the Enigma system was completely impervious to attack. Instead, they blamed the security lapses they were witnessing on espionage, or the presence of double agents within their own ranks. It was inconceivable to them that an encipherment system so sophisticated as the Enigma’s could prove susceptible to interception. After all, it was a German machine. Yet, as it turned out, the Enigma was immensely susceptible. Indeed, well before Captain Risley’s shooting party arrived at Bletchley Park, the team of Polish mathematicians led by Rejewski had been reading German military Enigma traffic for several years.
The astonishing saga of the code breakers is really an example of the power of mathematics. Hardy’s “clean and gentle” science, as it turned out, was stronger than the entire German war machine, which, for all its posturing, ended up being trumped by a group of geeky mathematicians and engineers working out their ideas on paper and fitting electrical switches inside ugly-looking machines. Luck had something to do with it: the Poles, for example, had at their disposal a commercial Enigma and two purloined German Enigma manuals, each including photographs and instructions. They also had much enciphered Enigma traffic to analyze. Had it not, however, been for the flashes of insight that led Rejewski and his team to crack the code, the intercepted telegraphs might have remained gibberish. Instead, through a combination of mathematical theory and sheer patience, Rejewski—and later Turing—managed to see a way through.
To some degree, their success owed to an innate weakness in the design of the Enigma. On every machine the rightmost rotor would have to shift through all twenty-six of its possible settings before the middle rotor made even a single shift; likewise the middle rotor had to shift twenty-six times before the leftmost rotor shifted once. As Budiansky explains, this meant that for stretches of twenty-six letters in any message enciphered using the Enigma machine, the settings to the left of the rightmost wheel remained unaltered: just the sort of weak point on which trained cryptanalysts know to pounce. Had the fast rotor been in the second or third position, the prospects for breaking the code would have been considerably dimmer.
On several fronts, moreover, German efforts to improve the security of the Enigma actually ended up making things easier for the cryptanalysts. One example of this kind of lapse was the German decision, early in the war, to instruct everyone in its Enigma network to double-encipher the messages. Upon sending a message, the operator would not use the daily key: instead, he would choose a key at random—say GSX—then encipher that key twice using the daily indicator key—say AMT. The result would be a sequence of six letters (say JMGVEB) that would represent the double encipherment of the key the operator had chosen, GSX, using the indicator AMT. Upon getting the message, the recipient would likewise set his Enigma machine to AMT and feed in JMGVEB, which would come out the other side as GSXGSX, thanks to the Enigma’s property of reversibility. The recipient would then reset the Enigma to GSX in order decipher the actual message.
From the standpoint of a German military officer intent on increasing the security of his Enigma traffic, this system of double encipherment must have seemed a stroke of genius; from a mathematical standpoint, on the contrary, it opened up a hole in the system. For the six letters that prefaced each of the enciphered Enigma messages sent on a given day—JMGVEB—in fact amounted to a faint “signature”: that is, in every message sent on a given day, the first six letters would have been enciphered using the same three-letter indicator key (in this case AMT).* In effect, this meant that the first six letters of every message being sent were enciphered using the equivalent of a polyalphabetic cipher the keyword of which was only three letters long, with the first letters all coded using one monoalphabetic cipher, the second letters all coded using a second monoalphabetic cipher, and so on. Moreover, there would be a traceable association between the first and fourth letters of the preface, as there would be between the second and fifth and the third and sixth. It was this point of vulnerability—the repetition in the signature—that Rejewski and his colleagues were able to exploit, since it allowed them to build up chains of letter associations, and by means of those chains to reconstruct all the cipher alphabets necessary for the breaking of each day’s traffic. (The creation of letter chains, as it happens, was an innovation of which Turing would take advantage when he assumed charge of the Enigma project a few years later.)
Unfortunately, the Germans soon abandoned this precaution in favor of a simpler method that did not require the use of daily keys. Now the sender of the message would simply choose a key himself (say AGH), then choose a second key (say DJX) with which he would twice encipher the original key. He would then transmit the original key unciphered followed by the twice-enciphered version of the original key. The result would be something like AGHLMODMP. The text of the message would then be enciphered using DJX as the key. The recipient would now set his Enigma to AGH in order to retrieve the key necessary to deciphering the message, in this case DJX. The system was not vulnerable to eavesdroppers, because not just the key AGH but also the secret daily ring setting were necessary in order to decipher the key DJX.
The new method of transmitting the key, though simpler, in fact made cryptanalysis more difficult because it erased the “signature” on which Rejewski and his colleagues depended. However, there was a way through. In a statistically significant number of instances, a letter in the key code being transmitted would purely by chance end up being enciphered twice as the same letter. For instance, in the example given above, LMODMP represents the double encipherment of DJX: feeding it into an Enigma set at AGH gives us DJXDJX. Note, however, that in this case J has twice been enciphered as M, purely by chance. For reasons lost to history, the Poles referred to these repetitions as “females.” Rejewski’s colleague Henryk Zygalski now went to work cataloging which of the 105,456 combinations of rotor orders and rotor settings (that is, 17,576 × 6) resulted in females. This task took the better part of a year. Next he crafted a series of perforated sheets in which the punched holes indicated all those positions in which a combination of rotor order and rotor setting resulted in a female. By repeatedly shifting the sheets in relation to one another atop a light table, and noting the points at which the light shone all the way through a perforation, Zygalski was able to work out the ring settings for a given day, and hence make a first step toward deciphering the traffic.
So far the Poles had dealt valiantly with every change that the Germans made to the Enigma system. Their ingenious work culminated in the invention of a machine that Rejewski called the bombe, either because of the ticking sound it made or (a less likely explanation) because he was eating an ice cream bombe at a café when the idea for it hit him. The bombe was capable of simulating the activity of several Enigmas wired together and could run through the 17,576 possible rotor settings of the Enigma in roughly two hours. By November 1938 six Polish bombes were in operation—and then, on December 15, 1938, and January 1, 1939, respectively, the Germans introduced two innovations to the Enigma that left Rejewski and his fellow mathematicians reeling. First, the Germans added two more rotors to the original complement of three; next they increased the number of steckered letter pairs from six to ten.
The result was more than the Poles could handle: they had neither the manpower nor the money to contend with such staggering new odds, especially given Poland’s increasing vulnerability to Germany. At this point, therefore, the principal Allied cryptanalytic effort shifted to Bletchley, where Turing and Welchman had at their disposal not only the resources of the British government but a considerably larger workforce. Before being forced to flee their homeland, however, the Poles were able to deduce the wirings of the two new rotors. They were thus able to present to Turing and Welchman, as a sort of parting gift, the complete wiring of all five rotors.
4.
Although the operations at Bletchley were ostensibl
y being run under the aegis of the military, the atmosphere that prevailed on the estate was a distinctly casual one. No one wore uniforms. Photographs show the cryptanalysts playing rounders on the lawn in front of the manor house. They took breaks for tea and generally enjoyed the fresh air and bucolic landscape of the local countryside.* And yet there was no question but that they understood just how deadly serious their work was. For instance, they knew better than to talk about what they were doing, even with their families, lest somehow the Germans should get wind of the fact that the Allies were reading their Enigma traffic. (For years Alan Turing’s mother knew only that her son was involved in some sort of government work.) A certain upper-class English suavity defined the mood of the place, a tacit acknowledgment that no matter how grim the situation got, duty required them to keep working, smiling, and, above all, silent.
And work they did. For security’s sake, the labor was divided up among groups each of which was assigned to its own building, most of these wooden “huts” that had been constructed in preparation for the estate’s transformation into a code- and cipher-breaking center. In Hut 8, Turing oversaw the theoretical side of things. Other huts were dedicated to the interception of coded traffic, to its transcription, to its translation, and to its interpretation. Crucially, each hut functioned independently of the others, which meant that Turing probably never learned what benefit the messages he deciphered provided the British in their struggle to defeat Hitler. His focus, instead, had to remain on the theoretical and mathematical dilemmas inherent in the effort to break this hugely difficult code.
One refreshing aspect of life at Bletchley was the large number of women employed there, most of them “Wrens” (members of the Women’s Royal Naval Service) from Cambridge and Oxford, who operated the decipherment machines and did much of the transcription work. Other women workers were recruited from a nearby corset factory. There was even one woman on the cryptanalytic team, Joan Clarke, a mathematician to whom Turing became briefly engaged. According to Hodges, when Turing admitted his homosexuality to his fiancée, she was unfazed; shortly thereafter, however, he decided that he could not go through with the marriage and broke the relationship off.
As Singh explains, the advent of the Enigma machine had heralded a substantive change in the science of cryptanalysis. “For centuries,” he writes, “it had been assumed that the best cryptanalysts were experts in the structure of language. . . .” Now, however, recruiters were focusing on finding men and women possessed both of striking creative capacities and innate patience. In addition to career mathematicians, the team at Bletchley included the British chess champion, Hugh Alexander, the writer Malcolm Muggeridge, and the winners in a competition to solve the Daily Telegraph crossword puzzle as fast as possible. (The record time recorded was 7 minutes, 57.5 seconds.) To succeed at cryptanalysis, one also had to be able to combine mathematical cleverness with a certain instinct for practical application: exactly the recipe that Alan Turing had brought to his efforts to solve the Entscheidungs-problem and that had left him feeling, in other contexts, like such an outsider.
At first, Turing and his colleagues at the Cottage emulated the methods of the Poles, creating a series of perforated sheets that could be laid one over the other in various arrangements. When light shone through all the sheets at once, it meant that the cryptanalysts had detected a “female.” Then, in order to accelerate the process of hunting for females, they built a small machine that they called, appropriately enough, a “sex cyclometer.”
Soon, however, it became clear that the old methods were not going to be sufficient, especially in light of the changes to the stecker board and the addition of the extra rotors. Instead, an entirely new framework would have to be developed if the team at Bletchley was to succeed in deciphering even a fraction of the Enigma traffic. And this framework Turing (whom his underlings had taken to calling “the Prof”) did develop, in an astonishingly short span of time. The result was the “Prof’s Book,” a messy, on occasion nearly illegible document several hundred pages in length, in which he laid out in detail the theoretical underpinnings of his planned attack on the Enigma. Given the increase in steckering, Turing saw, the cryptanalysts were going to have to depend increasingly on “cribs”—specific segments of plaintext that they could match, with reasonable confidence, to specific segments of ciphertext. As an example of a crib, Turing gave the plaintext (in German) “keine Zusätze zum Vorbericht” (“no additions to the preliminary report”), which corresponded to a stretch of cipher text as follows:
D A E D A Q O Z S I Q M M K B I L G M F W H A I V
K E I N E Z U S A E T Z E Z U M V O R B E R I C H T
The idea was to feed the message containing the crib through the various possible settings at which the ciphering process on an Enigma might begin, and then see which, if any of them, generated a comprehensible plaintext. If none worked, it would be necessary to start again, matching the crib to a different segment of ciphertext. But this was an extremely time-consuming process, as well as one in which, working by hand, cryptanalysts were likely to make mistakes. Moreover, it was not possible to make even a dent in the huge volume of Enigma traffic by the use of just scissors, pens, and pencils.
Early on in his stay at Bletchley, it had become evident to Turing that the only way to break a cipher created by a machine would be with machine. The insight was a variation on the one that had led him to write “Computable Numbers.” This time, however, the machine in question could not remain merely hypothetical. He had to build it.
The result was the second-generation bombe, both faster and more technically complex than its Polish forebear. Also bigger: more than six and a half feet high and seven feet wide, and weighing a ton. In essence, this mechanical behemoth simulated the efforts of thirty Enigma machines working at once. The rotors—ninety of them—were mounted on the face of the immense cabinet, a glance at the back of which revealed more than ten miles of wire connected to contact points on the rotors. The bombe could be temperamental, giving its operators electric shocks or nipping at their fingers. It leaked oil and regularly jammed. But it worked, and eventually a whole series of bombes was commissioned, each one given a unique name. (These included Victory, Otto, Eureka, and Agnus Dei.)
Designing the bombe gave Turing the opportunity, at long last, to fulfill a lifelong dream. As a child he had drawn a blueprint for a typewriter. After writing “Computable Numbers,” he had made significant progress toward constructing both the electronic multiplier and the machine to test out the zeros of the Riemann zeta function. But he had never actually completed any of his machines. Now, at Bletchley, he was being given the chance not just to apply principles of mathematical logic to the actual construction of a machine but to oversee its installation and put it to work. For the miracle of the bombe was that this ungainly conglomeration of multiwire cables, brushes, and switches operated entirely according to the methods Turing had learned as a result of his deep immersion in the world of Frege and Russell; indeed, as each bombe clicked its way through thousands of eliminations and checks each day, it was as if the heartbeat of logic itself was being heard.
The so-called “bombe,” designed by Alan Turing and his colleagues at Bletchley Park to decode encrypted Enigma traffic. (Imperial War College)
Yet Turing’s achievement went beyond merely building the bombes: along with his colleague Gordon Welchman, he also figured out novel and ingenious ways to use the machine. For instance, one of the principal challenges facing the cryptanalysts at Bletchley at the beginning of the war was the dilemma of how to deal with the millions and millions of new letter combinations that resulted from the increase of steckered letter pairs from six to ten. At first the problem seemed insurmountable; rather quickly, however, Turing came up with a geometric model for chains of letter combinations within the Enigma that swept away the effect of the stecker board entirely. In effect, he took a geometer’s approach to the problem.
Here is Stephen Budiansky’s example of
what Turing did. Let’s assume that, by using a crib, we’ve worked out a clear matchup between a plaintext and a ciphertext. First we lay out the relative positions of the letters:
It is now possible to map the geometric relations between the plaintext letters and the ciphertext letters. For example, in position 6, H is transformed into T, while at position 3 T is transformed to I; at position 2, I is transformed to M, while at position 1, M is transformed to H. We now have a closed loop of letters, from H back to H. Similar closed loops could be mapped for the remaining letters. Using these loops, Turing was able to work up a diagram of the steckering used in any particular message, thus eliminating the stecker board’s effect.
Turing’s insight, in this case, owed entirely to his mathematical training, from which he had learned that geometric relationships remain constant even as the variables introduced into them are changed. Turing also exploited—cunningly—what were considered the Enigma’s greatest strengths: its reversibility, which allowed it to be used as both an encipherment and a decipherment machine, and the fact that it never ciphered any letter into itself. Finally, he built a version of the principle of reductio ad absurdum into the engineering of the machine, which could, in effect, draw conclusions from contradictions: that is, it was designed to interpret the registering of an invalid rotor setting as an instruction to test out the next possible rotor setting. The machine would stop only when either one circuit or twenty-five circuits were energized, indicating the possibility of a setting that actually worked.
In striving to master the Enigma, Turing and his colleagues took advantage of every bit of outside help they could get. Much of their work rested on an intricate (and brilliant) mathematical foundation; at the same time, they benefited considerably from the lack of imagination that appeared to be endemic to the German military. For instance, getting hold of usable cribs would have proven to be considerably more difficult had the authors of the messages fed into the Enigma bothered either to avoid common phrasings or to ensconce the actual message in nonsense text. More commonly, the messages intercepted by Bletchley were replete with formulaic language, military clichés, and habitual repetitions: they reeked of bureaucracy. (Most messages, for example, mentioned weather conditions, almost always according to the same formula; thus, as Singh notes, Wetter—the German word for “weather”—was a common crib.) When the supply of cribs threatened to run dry, the Royal Air Force sometimes helped the cryptanalysts out by planting mines in locations specifically chosen so that the Germans would find them and send back reports of the discoveries; because the English already knew where the mines were, these location reports provided ready-made cribs that Turing and his team could exploit. This process was called, rather quaintly, gardening.