Virtual Bletchley Park
by Tony Sale

| Back to Wartime BP |

Tony Sale's
Codes and Ciphers

The Breaking of Enigma by the Polish Mathematicians


As German military power increased during the 1920's, the Poles felt threatened and vulnerable, situated as they were between two powerful nations, Germany to the West and Russia to the East.

In order to discover the intentions of their potential enemies, they resorted to intelligence gathering. They had a long tradition of this and particularly of code breaking.

The modern use of Radio allowed them to intercept enemy Radio transmissions without revealing their intelligence activities.

From 1928 onward Polish Intelligence intercepted German Radio transmissions using a new cipher system which was eventually identified as coming from an Enigma machine.

Polish Intelligence had obtained examples of the commercial Enigma machine but quickly found that the German Enigma was different in detail from the commercial version.

The Polish Mathematicians

Polish Intelligence were initially unable to break the German Enigma traffic, however driven by the imperative of finding what the Germans were up to, they, uniquely among other nations at that time, decided to try a mathematical approach. In 1932 a team of young mathematicians was set up. It included Jerzy Rozycki, Henryk Zygalski and Marian Rejewski (all of whom were products of the notable flowering of Polish mathematics in the 1920s and 1930s).

Rejewski quickly showed that mathematical techniques could be used to attack the problem of finding the message key by exploiting the German's cryptographic error in repeating the message key at the start of a transmission.

The problem that still had to solved was the internal wiring connections in each wheel. In this Polish Intelligence were helped by the French. The French were very interested in assisting Poland because they also were disturbed by the rise in German militancy and wanted an ally on Germans Eastern flank.

In 1931 and 1932 the French cryptographer Gustave Bertrand obtained priceless information about the German Enigma from a spy, Hans-Thilo Schmidt, known by the code name Asche. The French were unable to use this information to break into the German Enigma traffic. It was also passed to the British who were also at this time unable to break into Enigma. Finally Bertrand passed the information to Polish Intelligence who had not revealed how far they had got with their attack on Enigma. This information, which included German operating instructions for Enigma and two sheets of monthly key settings enabled Rejewski to deduce the internal wheel wiring for all three wheels, but only after he had made an inspired leap of imagination. The problem was the order of the 26 wires connecting the keyboard to the fixed entry disc at the right hand end of the three wheels.

In the commercial Enigma, which the Polish team possessed, the wiring order clockwise round the entry disc was the order of the keys on the keyboard, QWERTZUIO... Rejewski had realised that the wiring order must be different on the German Forces Enigma, but had no way of finding out what the order was. The inspired leap of imagination was to suppose the Germans had, in their logical way, just used ABCDEFG... as the order. He tried this and it worked and he could now work out from his equations the internal wiring of the three wheels and the reflector.

The deduction of the internal wiring of the wheels was a spectacular feat by Rejewski. It enabled the Polish cryptographers to build replicas of the German Enigma machine which could then be used to decipher the intercepted Radio messages once the Enigma configuration and the message settings had been deduced.
That was the next problem. Rejewski had shown that his "characteristics" could be deduced from a day's radio traffic when the Germans were double enciphering the Enigma message settings. Now the Polish cryptographers had to produce a catalogue of these characteristics for every wheel order and every wheel start position, 26x26x26x6 entries,(no less than 105,456 in all!), in order to deduce the Enigma configuration for that day.

They devised a machine which they called a Cyclometer. This consisted of, in effect, two Enigma machines side by side with their right hand wheels offset by three places.

Click here to see how Rejewski's characteristics were catalogued and used.

Then in September 1938 the Germans changed the Enigma procedures for enciphering message keys. They no longer started the message key encipherment from one standard set of wheel positions set for the whole 24 hour period, but asked the Enigma operator to choose a different encipherment start, known as the indicator, for each message sent and to transmit the chosen indicator with the double enciphered message setting in the header of the German message.

This meant that Rejewski's characteristics no longer worked because they depended on all message key encipherments being from the same wheels start positions.

The Zygalski Sheets

When they had been studying the double enciphered message settings in order to construct Rejewski's characteristics, cases had been noticed where the same enciphered letter occurred in either the 1st and 4th, or 2nd and 5th, or 3rd and 6th positions in the enciphered message settings. These positions, which were called females, corresponded to positions at which the same letter had been keyed by the German operator into the Enigma machine because of the repeat of the three letter message key.

Zygalski realised that whether this occurred or not depended on the wheel order and the start position, therefore inversely if it did occur it implied one of a set of possible Enigma configurations. If enough of these doubles occurred during a days traffic it might be possible to find a unique configuration for which all of these doubles could occur.

Click here to generate a set of intercepts on random indicators and message keys.

The settings of the Enigma were: wheels 132 rings QJF and no Steckers. The list of 234 intercepts contains 34 females of which 14 are of the 1,4 type.

Zygalski realised that the analysis of the vast amount of information required could be achieved by a grill method using perforated sheets.

The sheet procedure involves working through each of the six possible wheel orderings for three wheels and for each wheel order working through the 26 possible left hand wheel ring letters, 156 tries in all, but on average only half before the answer is found.

There were sheets prepared for each left wheel letter for each wheel order. Each sheet contained four squares of 26 by 26 ie two alphabets along the top and down the side.

The first decision was which wheel order to try, (in our case 132) and which ring first letter, in this case Q. Next take the first letter of the first indicator that gives a 1,4 female in this case P and get the sheet 123 Q P. Place this on the table offset by the next two letters of the indicator, TJ. Now get sheets for succeeding indicators overlaying them on the table. If the wheel order and the first ring letter are what was used to encipher the message key then one square will line up and let light through from below the table. The original ring setting can now be deduced from the co-ordinates of this lit square.

Click here to try overlaying Zygalski sheets.

This emulation of the Zygalski sheets calculates the offset of a sheet and recreates the overlaid portion of each sheet at run time. This minimises the downloaded information but takes a little time to recalculate each sheet. Click here for a description of the calculations required to do this.

Rejewski's Bomba

Rejewski also had the idea for a mechanical method for finding the Enigma ring settings from the females in the double enciphered message settings.

This was called the Bomba. Long after WW II Rejewski drew a sketch of it. The idea was to rotate six sets of enigma wheels in synchronism with each set being one fast wheel position in advance of the preceding one so that the six positions corresponding to the double encipherment of the message setting could be examined simultaneously looking for repeating enciphered letters.
Six of these machines were required, each set with one of the six possible wheel order for the possible three wheels in the Enigma machine. The Bombas were not very reliable and Zygalski's sheets produced better results.

In interviews after the War, Rejewski was quite clear that the Bombas were designed specifically to attack the double encipherment of the message setting. They were not designed, or ever used, for a general "known text" attack.

Successes, Failure and a Priceless Gift

Using these techniques the Polish cryptographers were, by 1938, reading some 75% of intercepted German Radio transmissions enciphered using the Enigma machine. They kept this a very closely guarded secret, telling no one of their successes.

Then in 1938 the Germans brought another two wheels into service so that the German operator now had to chose three out of five to put into the Enigma machine. This raised the amount of effort required to find keys way beyond what Polish Intelligence could provide.

In July 1939 with the invasion of Poland imminent, the Polish cryptographers decided to share their Enigma results with the French and British code breakers. At a meeting in the Kabackie Woods near Pyry just outside Warsaw all was revealed to the utter astonishment of the French and British. The Polish team gave them copies of the German Enigma machine and revealed the details of the Cyclometers, Bombas and Zygalski sheets.

Just before the German invasion, the three Polish code breakers escaped through Roumania and eventualy joined up with Gustave Bertrand and his French team at Chateau Vignolles in France just outside Paris.

This page was originally created by the late Tony Sale
the original curator of the Bletchley Park Museum