The Secret in Building 26
Page 4
2
Guesswork, Moxie, and Just Plain Luck
JOE DESCH WASN’T the only engineer struggling to design a machine nimble and reliable enough to take on the four-wheel Enigma. Throughout the summer of 1942 and into early 1943, the British were still battling internally over the design of their own four-wheel Bombe. In fact, when the Americans pressed them for blueprints of their latest Bombe in April 1942, none may have existed. By then, C. E. Wynn-Williams, the renowned British scientist who had invented the most advanced electronic radiation counters of the 1930s, was exploring an add-on device for the three-wheel Bombes that would make them fast enough to attack the four-wheel problem.
The Cobra, as his device was called, allowed a high-speed fourth wheel to be added to the existing Bombes and required a bank of vacuum tubes to track spinning-wheel positions lasting less than one-thousandth of a second. A thick black cable of nearly two thousand wires connected the add-on to the three-wheel Bombe; hence the name Cobra. The first Cobra prototype was not tested until April 1942, and then it ran into problems with the metal brushes on its high-speed wheels bouncing and skipping over the electrical contacts. The design was scrapped, and a second prototype was tested in June, again with poor results.
That the British had been able to break into the German naval ciphers at all owed much to good guesswork, moxie, and just plain luck. The Bombes themselves wouldn’t work without a steady supply of good cribs, often created by German lapses, laziness, or predictable routines such as standard greetings for commanders. Timely captures of procedural manuals, Enigma wheels, and codebooks had rescued the British from several blackouts as well. So desperate was the need for codebreaking crutches that the British Navy had hatched a strategy of ambushing German weather ships, isolated far out at sea, to capture their Enigma materials.
In the first months of 1942, the British codebreakers were still hoping they might acquire copies of the German Navy’s new weather and short-signal codebooks. These contained a kind of shorthand for frequently used terms in U-boat messages, such as those relating to weather observations and U-boat and convoy locations. Aware that the Allies were using new direction-finding equipment to zero in on longer radio transmissions, the Germans kept their U-boat reports as brief as possible. Until Britain could steal the new codebooks and thus gain a flow of cribs, even four-wheel Bombes would have been of little use against Shark. Good cribs were hard to find and remained so throughout the war.
More fundamentally, the Allied codebreakers and their machines were dependent on a variety of inherent weaknesses in the Enigma system—flaws that at any moment the Germans might take steps to correct. OP20G’s request for the millions of dollars necessary to start the Dayton project contained an ominous warning to the Navy’s top brass: the Bombes might be turned into useless contraptions if the Germans changed their procedures and tweaked the workings of their Enigma machines. Even as OP20G’s leader, Joseph Wenger, and the man he put in charge of the Enigma problem, Howard Engstrom, were pressuring Desch to deliver his Bombe, they also worried that the machines might become expensive and very embarrassing cryptodinosaurs.
The Allies got their biggest break from the Germans themselves: their cryptologists suffered from a smug complacency based on the Enigma’s staggering number of ciphering possibilities. But if the Enigma suffered from any flaw, it was that it, like the rest of the German military, relied on a consistent, predictable logic that could be turned in favor of its enemies. First of all, the Enigma never enciphered a letter to itself—A could never scramble to A, B could never scramble to B, and so on. What’s more, the machine’s enciphered letters were always reciprocal to their plain text partners: if X ciphered to Y then Y would always cipher to X at the same setting. Finally, the machine’s plugboard allowed only one letter at a time to be steckered to another, so that if A was swapped with B, then B would always be swapped with A.
Before the war, codebreakers had developed a variety of hand methods based on these features to narrow the possibilities and to locate suspected cribs. One attack, called rodding, was used successfully against simpler Enigma machines that had no plugboard. Strips of scrambled alphabets were drawn up to represent the encipherings for each of the possible Enigma wheels and glued to sticks or rods. The columns of scrambled alphabets could then be lined up against the text in the message and slid into different pairings, creating a paper analog for the wiring inside the Enigma machine. Rodding eliminated the many wheels and starting positions that the Enigma did not allow—such as A enciphering to T while T enciphered to X. It was also used to test the validity of a suspected crib: any plain-text letter in a crib that enciphered to itself was again contradictory and called a “crash.” *2
Knowing that the commercial Enigma had been vulnerable to such attacks, the German military added its letter-swapping plugboard to all its models before the war—a devilish hurdle, but not enough to keep the British from penetrating their system.
THE BREAKTHROUGH INTO the wartime Enigma was achieved not by an experienced codebreaker but by a young Cambridge University mathematician named Alan Turing, recruited by GCCS in 1938. Turing found a way of turning the internal logic of the Enigma machine itself into an ingenious codebreaking machine, the first British Bombe. Turing sought methods that would withstand tweaking of the Enigma and its code systems. One of his methods, dubbed Banburismus because it used punched sheets of paper made in the nearby town of Banbury, employed a statistical approach—an expansion of an earlier cipher-breaking strategy that the American Army’s code guru, William Friedman, had called the Index of Coincidence (IC) method. In essence, the IC was based on laws of probability: to find out if two messages had been encrypted by the same Enigma setup, an analyst slid the text of the two messages over each other to see if there was more than a random percentage of letter matches.
Banburismus and the IC method, developed independently by the British and the Americans, both exploited laws of letter distribution that any good Scrabble player would recognize—that is, every letter and letter combination within a language occurs with a signature regularity. For example, it was known that the letters E, I, and N were among the most frequently appearing letters in German military texts; their replacement letters also would appear more often if enough message text was analyzed. In an IC analysis, a second message had to be shifted one letter at a time over the first message until all the letter positions of the first message were compared to the second. The reason was simple: the starting positions of the enciphering machine’s tumbling rotors changed with each keystroke, creating what seems like a random stream of letters. But, eventually, even the most complex ciphering machine completes a cycle and begins again with the same rotor starting positions. So, wherever the alignment between the two messages created more matches than one would expect from a random distribution of letters, both messages were probably produced by the same wheels, wheel settings, and portion of the machine’s encryption cycle.
To speed up the process, Banburismus used punched sheets of paper, with the positions of the holes representing different letters of each enciphered message. Two punched sheets of cipher text were aligned, then shifted over each other one letter position at a time. Wherever the holes matched, the letter matches could then be tallied and weighted.
Clever as it was, Banburismus suffered from several drawbacks: it was labor intensive and slow, demanded hundreds of messages for analysis, and was practical only for reducing the number of wheel orders to be tested—and even then only against the three-wheel Enigma machines. As soon as they had enough Bombes in 1943, the British dropped Banburismus.
Much like the British, the Americans, too, began with high hopes that their own IC methods and machines could conquer the Enigma. But they learned that this approach could tell them only the starting positions of the Enigma wheels after the harder parts of the setup were known.
Turing had predicted that Banburismus might not be powerful enough to tackle all the Enigma keys and searched f
or another method of attack. In mid-1939, after studying the techniques of other British codebreakers and those of the Poles, Turing took a truly brilliant leap that perhaps only a theoretical mathematician could have devised. He realized that the identity of the ciphered letters generated by the Enigma did not matter as much as the patterns of their relationship to the plain-text letters of the crib. Of particular value were those series of letter pairs that formed a “loop,” or closed circuit, back to an original letter. Such loops could be simulated and tested in the electrical circuitry of a machine. *3
For instance, if a crib text was suspected of having A enciphered to E, followed by E enciphered to D, and finally D enciphered back again to A, that series of letter pairs formed a loop. A loop “test” on a machine could help eliminate vast numbers of wheels and wheel positions that could not have produced such a distinctive pattern.
In another stroke of genius, Turing combined his loop test with a second test that could help conquer the most difficult part of the Enigma, its steckers. He realized there was a basic weakness in the Enigma plugboard: if one letter was steckered to another, that letter and its mate could not be steckered to any others. A could not be steckered to both B and X, for example. And, of course, if A was plugged to B, then B must be plugged to A.
Turing’s idea was to exploit this reciprocal relationship by seeing if a potential Enigma setup produced more than one stecker for any letter. If so, then even if the loop test had been passed, the setup would be ruled out. But if the setup passed both tests, then the correct stecker combination could be identified out of the 533 trillion possible.
Although created with a three-wheel Enigma as its target, Turing’s Bombe approach would remain the basis for the war’s most potent attack against the Enigma. Even so, the Bombes were neither all-powerful nor fully independent. They were not intended to and could not identify all the components of an Enigma setup. The method was aimed at only two: the combination of wheels used in a machine and the steckers. It did not solve the wheel wirings, and it left the identification of the ring settings and starting positions of the wheels to hand attacks.
The Bombes assumed prior knowledge of the wiring of the Enigma wheels, which already had been captured. And unless there were ways to eliminate possible wheel combinations, the method demanded that all be tested. In the case of the four-wheel naval Enigma, that meant an average twenty-minute Bombe run for each of the 336 possible wheel combinations—or more than four and a half days for a single Bombe to crunch through all the possibilities.
The Bombes also relied on finding cribs that contained loops and other helpful patterns. Only with relatively long and rare combinations of letter relationships would the Turing tests be powerful enough to eliminate most possible wheel combinations and stecker assumptions. Good cribs not only were hard to find but were vulnerable to changes in German procedure.
Finding useful cribs and their precise location within a message was both an art and a science. It required an intimate knowledge not only of German but of Enigma message formats and German military conventions and terminology. Routine messages were a blessing for crib analysts, as was the need to spell out numerals on the Enigma machine’s alphabet-only keyboard, often leading to repeated patterns of text such as NULLNULLNULL. Routine weather reports and submarine reports of convoy sightings were sources of predictable content and, hence, cribs. The big break into the Enigma for D Day, for instance, came with the words WETTERVORHERSAGE BISKAYA—in English, “weather forecast Biscay.” *4 As a result, Allied forces were better able to predict where and when German defenses would respond.
TURING’S LOGIC NARROWED the search for the correct Enigma setting from trillions to more manageable millions, bringing a timely solution within the grasp of codebreakers—but only if a machine could be invented that could plow through those remaining possibilities at unheard-of speeds. When Turing first thought of embodying his test in an ultrahigh-speed machine, electronics seemed the rational choice. Bletchley’s codebreakers turned for help to H. H. (Doc) Keen at the British Tabulating Machine Company (BTMC), the equivalent of America’s IBM. Keen, BTMC’s experienced chief engineer, could, like Desch, be counted on to produce tried-and-true technical results. Faced with the challenge of producing a working machine in a short period of time, Keen quickly declared an electronic machine impractical. Bletchley’s codebreakers, trusting in Keen’s judgment, handed him control of the Turing Bombe project, and he delivered the first machine in March 1940. The result was crude, lacking many later features and designed only for three-wheel Enigma problems—but it ran.
Although it proved too slow and too weak in its cryptanalytic power to provide timely information, it vindicated Turing’s design and Keen’s technological choices. GCCS decided to use some of its hard-pressed budget on an improved model, which was delivered in August 1940. That second machine—although it, too, lacked many automated features—became the model for the architecture of all the British and American Bombes produced during the war.
Keen had taken on a difficult task with little time for experimentation. His machine had to turn loops and stecker contradictions into electrical flows and do so within the framework of Turing’s logic of elimination. The Keen Bombe was what computer scientists now call a parallel/analog machine: it sensed the amounts of electrical current running through the machine and the states of its electrical switches, either closed or open.
The technology was electromechanical, not electronic, which meant the use of motors, gears, and spinning drums as well as typical electrical parts such as relays and resistors. Much of the Keen Bombe came from the standard pool of parts for tabulating machines and telephone systems. The spinning drums, or commutators, designed to simulate the Enigma wheels, had twenty-six electrical contact points, one for each letter of the alphabet. The only proven technology at the time for sensing the current passed on by the spinning disks was the small wire brushes already in use on IBM punched-card equipment. Relays, such as were in use at the time for telephone switching, were added to track the movement of the drums from letter to letter and turn their voltages into useful signals.
To create a machine that could make thousands of connections and decisions every second, without a single error during runs of ten to twenty minutes, Keen often had to push components beyond their limits of speed and reliability. Turing’s attack demanded a machine that was “perfect,” but, many times, the existing technology refused to cooperate. The metal sensing brushes, for example, had a bad habit of breaking off and causing short circuits. The tumbling action of the middle and slow wheels could easily cause them to miss the voltage sent through the fast wheel. And the relay switches refused to perform fast enough to keep track of the signals from the commutators when they whirled at their highest speeds.
Those stubborn relays are what made cracking the M4 Shark so daunting. In theory, at least, a modified three-wheel Bombe could have attacked the Shark, but with the increase in the number of possible starting positions from 17,500 to 450,000, the standard relays of the first Keen Bombes simply were not up to the task.
Keen and his technicians quickly constructed a simulation of the Enigma wheel that could be run accurately at high speeds without deteriorating. Each drum contained the input and output contacts needed to change one letter to another, just like an Enigma wheel. Based on a clever idea suggested by Turing, Keen’s wheel combined both the forward and backward wiring of an Enigma rotor into a single spinning drum, allowing signals to pass in both directions, greatly increasing Bombe efficiency. *5
Keen’s ingenuity was limited by the technology of his day, however. He could not build a drum that could be automatically changed to mirror the wiring of each of the many Enigma wheels. He had to construct a separate drum for each wiring—a manufacturing and logistical challenge for Britain’s scarce wartime resources. There were six different wheels for the Air Force Enigmas and eight for the naval Enigmas alone. Each of the Enigmas simulated in a Bombe called first for t
hree, then four wheels. A typical run on the early Bombes often meant changing hundreds of different wheels because each possible combination had to be tested separately.
Permanently mounting that many wheels on a Bombe and designing a way to move each wheel automatically to its correct starting position was impractical. Technology limited the Bombes to testing a single wheel combination per run. Keen’s design allowed the wheels to be removed manually or reset at each run. Which wheels were selected depended on the analyst’s best guess as to which ones the Germans were using. The letter positions of the wheels were dictated by the “menu”—a very specific portion of the crib that included loops and other special patterns formed by pairing the cipher and plain text letters.
Rather than sandwich the three rotors together as in the Enigma itself, Keen fit each commutator flat on the front panel of the Bombe, which made their replacement easier. The wheels were arranged with the fast-moving rotor at the top, the middle next, and the slow wheel at the bottom. Connections behind the panel joined the three rotors together.
Ironically, the very part of the Enigma machine that the Germans felt made it impenetrable was turned to the Allies’ advantage through Turing’s genius—its letter-swapping stecker board. Guessing at the stecker for a menu letter improved the efficiency of the Bombe by eliminating even greater numbers of settings. If the Bombe operator guessed the correct stecker and the Bombe was set up with the correct wheels and positions, then the current would zip at nearly the speed of light around the letter loops of the menu and stop without sending current to any other of the twenty-six wires. The flow of current through the correct wheel positions would create what codebreakers called a “hot point” on the Bombe’s register board—and only one of them. Sensing this point, the Bombe stopped and indicated that the wheel positions might be a solution. *6