In the summer of 1939, with five weeks left before the invasion of Poland, three young mathematicians in woods south of Warsaw handed the Allies a secret they had spent seven years cracking — and set off a chain of events without which the history of World War II would have looked different.
The commercial version of Enigma appeared on the market in the 1920s — a bulky box with a keyboard, a set of rotating rotors, and a lamp panel. You press a letter — another one lights up. The rotors turn, and the same letter produces a different result the next time you press it. The military version, which the Reichswehr and then the Wehrmacht began introducing in the late twenties, differed from the commercial one by the addition of a plugboard (Steckerbrett), where pairs of letters were further swapped by wires. The plugboard exploded the space of possible settings: if three rotors gave around 17,576 starting positions, the plugboard connections added an astronomical number of combinations. German cryptographers considered the system impregnable — and, essentially, it was, if you attacked it by brute force. But brute force is not the only tool.
Poland in the interwar period lived in close proximity to two powers, each of which had territorial claims on it. Intercepting German military messages was a matter of survival for Warsaw, not academic interest. Biuro Szyfrów — the Cipher Bureau of the General Staff — had already gained experience with German ciphers by the early thirties, but the Wehrmacht’s shift to machine encryption put a wall in its path that linguists and traditional codebreakers could not breach. The solution the Bureau’s leadership arrived at was unusual for the time: recruit mathematicians.
At Poznań University, Professor Zdzisław Krygowski taught mathematics, and among his students were people the Cipher Bureau had singled out for secret work. Poznań was a city in western Poland where a significant part of the population spoke German; mathematics students from the region combined two rare qualities: abstract thinking and fluent German. The selection and organization of the university’s cryptology course were handled by Major Franciszek Pokorny, Maksymilian Ciężki, and Antoni Palluth — officers who understood that the future of military cryptology belonged not to philologists, but to algebraists.
Marian Rejewski, born on 16 August 1905 in Bromberg (Bydgoszcz in Polish), was one of those selected. Along with him, Jerzy Różycki and Henryk Zygalski entered the Bureau’s orbit. All three were young — Rejewski was twenty-seven at the moment of the decisive breakthrough. They were transferred to Warsaw, and from that moment begins a story I consider one of the most beautiful in applied mathematics of the 20th century — beautiful in the practical, engineered sense, without any romantic mist.
The problem facing Rejewski in late 1932 was simple to state: determine the internal wiring of the military Enigma’s rotors without access to the machine itself. The wiring was the substitution table inside each rotor, and without knowing it, any analysis of ciphertext remained blind. Rejewski approached Enigma as a composition of permutations: each rotor was a permutation of the alphabet, the reflector (Umkehrwalze) another, the plugboard a third. Encrypting a single letter was the product of these permutations, and the properties of that product could be studied algebraically.
The crucial vulnerability turned out to be the German procedure for transmitting message keys. Every message began with the operator choosing a random three-letter “message key” and encrypting it twice in succession — to guard against transmission errors. The first six letters of every intercepted message were thus an encryption of the same three-letter block, typed twice. Rejewski saw that the first and fourth letters of this six-letter header corresponded to the same original letter, but encrypted with the rotors in different positions. The same went for the second and fifth, the third and sixth. This yielded three pairs of permutations, and their products could reveal a cyclic structure.
Cyclic structure is a thing of pure algebra: if a permutation maps A→F→K→A, that is a cycle of length three. By collecting enough intercepts in a single day — and the Germans sent hundreds of messages — Rejewski could reconstruct the full cyclic structure of each of the three pairs and use it as a fingerprint of the current settings. But to turn those fingerprints into actual wiring, he needed one more detail — at least partial information about the real settings for at least a few days.
That detail was supplied by French intelligence. Gustave Bertrand, an officer of the Deuxième Bureau, had been receiving material from Hans-Thilo Schmidt since the early thirties — a German official working in the Reichswehr’s cipher office who sold secret documents for money. Schmidt passed on tables of Enigma’s daily settings — the very keys that changed every month. The French were unable to use the material themselves to break the machine and, under their cooperation agreement, passed it on to the Poles. Schmidt’s documents reached Rejewski around 8–10 December 1932.
The combination proved decisive. Rejewski’s algebraic method provided a system of equations, while Schmidt’s documents supplied enough initial conditions to solve it. Rejewski reconstructed the rotor wiring. This was the moment the lock clicked — but the door still had to be opened anew every day, because the Germans changed the settings daily: rotor order, starting positions, plugboard connections.
What gets me about this story is how modest the toolkit was. Rejewski worked with pencil, paper, and permutation theory — a branch of algebra that had been developed for more than a hundred years by then. He invented no new mathematical apparatus. He saw that the existing one mapped precisely onto the machine’s construction — and that insight was worth more than any supercomputer, which did not exist anyway.
After reconstructing the wiring came the routine — and yet inventive — work of breaking the daily keys. The three mathematicians created an entire arsenal of methods.
The cyclometer, built in 1936, was a device made of two connected sets of Enigma rotors. It made it possible to systematically run through rotor positions and record the cyclic structures of the permutations for every possible starting position. The result was a catalog — 105,456 entries, essentially a card index in which each set of cycle lengths corresponded to a particular setting. Once they obtained a cyclic structure from the day’s intercepts, the cryptologists simply looked it up in the catalog. Meticulous work, like compiling tables of logarithms — but it delivered results.
Then, on 1 November 1937, the Germans replaced the reflector — Umkehrwalze A with Umkehrwalze B. The entire catalog compiled for the cyclometer became useless: the cyclic structures had changed. Rejewski and his colleagues had to start over. It was the first blow, but far from the last.
In September 1938, the answer came in the form of two new tools. Rejewski designed the cryptologic bomb (bomba kryptologiczna) — an electromechanical device that automatically ran through rotor positions, testing hypotheses about the message key. Six sets of Enigma rotors, combined in one casing, rotated in sync, and the machine stopped when it found a match. At the same time, Henryk Zygalski developed a method using perforated sheets — large paper tables with holes punched in specific positions. By laying the sheets over one another on a light table, the cryptologists looked for positions where light passed through every layer: each such point indicated a possible initial setting for the rotors.
The manufacture of all this equipment — and working copies of Enigma itself — was undertaken by the Warsaw radio-electronics firm AVA, founded by brothers Leonard and Ludomir Danilewicz. The firm employed engineers Edward Fokczyński and Antoni Palluth — the very officer involved in selecting cryptologists in Poznań. From 1934 onward, AVA produced functional copies of Enigma — machines assembled to specifications reconstructed by Rejewski. It was a full-fledged small-batch production line, hidden in an ordinary Warsaw workshop.
By the summer of 1939, the situation had become critical. The Germans were increasing the complexity: they added fourth and fifth rotors to the set — three of which would be installed in the machine — raising the number of possible orders from six to sixty. Polish resources, both human and financial, were exhausted. Making the bomb work under the new conditions would have required ten times as many devices, while Zygalski’s sheets would have required sixty new sets of perforated tables. The small team of three mathematicians and a handful of engineers had hit the ceiling of scale.
The decision was political: share everything. On 25 July 1939, a secret three-day meeting began at the Cipher Bureau’s woodland facility in Pyry — a suburb south of Warsaw. The British delegation was led by Alastair Denniston, head of the Government Code and Cypher School — the future Bletchley Park; with him came Dilly Knox — one of Britain’s finest cryptanalysts, a veteran of the First World War — and Humphrey Sandwith. France was represented by Gustave Bertrand and Henri Braquenié.
What happened next, Knox later described as a shock. The Poles showed them everything: the reconstructed rotor wiring, the key-recovery methods, the cyclometer, the bomb, Zygalski’s sheets. And they gave each side a working copy of Enigma — the very machines manufactured by AVA. The British, who had been struggling with Enigma for years and considered the task, in Knox’s words, almost hopeless, received a ready-made foundation.
The meeting continued until 27 July. Five weeks later, on 1 September, the Wehrmacht crossed the Polish border.
Here it is important not to slip into mirror-image mythology. There is a British myth — of Turing the genius, breaking Enigma alone in a country estate. And there is a Polish one — of the trio of mathematicians who did all the work while the British merely harvested the fruits. Reality, as usual, is more complicated and more interesting than either version.
By the time of the meeting at Pyry, Bletchley Park was already working on Enigma. Knox was tackling the problem, while Britain’s Y-stations were collecting German traffic. But without the Polish breakthrough, the British were, roughly speaking, picking at the lock with a tool, not knowing how many pins it had. The handover at Pyry gave them a complete diagram of the lock — and proof that it could be opened.
Then came a scale Poland had never possessed. Alan Turing and Gordon Welchman designed the British Bombes — electromechanical machines conceptually related to the Polish bomb, but radically more powerful and based on a different principle: the use of “cribs,” presumed fragments of plaintext. At the peak of operations, more than two hundred such machines were in service at Bletchley Park. The network of intercept stations covered the entire Atlantic and the Mediterranean. Thousands of people — linguists, operators, couriers, engineers — kept the conveyor belt moving, turning intercepted radio messages into Ultra intelligence summaries. Added to this were captured codebooks and rotors from German submarines and ships — each such trophy provided material for another leap forward.
The Polish trio laid the foundation. The British system raised an industrial-scale structure upon it. One did not work without the other — or, more precisely, it would have worked months or years later, time the Allies did not have.
In May 1940, the Germans changed their key-transmission procedure — abolishing the double encryption of the three-letter message key. The very vulnerability Rejewski had exploited since 1932 — the six-letter header with its repeating structure — disappeared. The cyclometer, the catalog, the bomb in its Polish form, and Zygalski’s sheets in their original application lost their direct effectiveness.
But the foundation — knowledge of the rotor wiring, an understanding of the machine’s architecture, the very principle of an algebraic approach to an electromechanical cipher machine — remained. The British Bombes were already operating on a different principle and did not depend on the procedural change. Turing, essentially, had foreseen something like this: his method relied not on a procedural weakness, but on the statistical properties of the ciphertext itself and presumed fragments of plaintext. The Polish school gave him a starting point — and from there he ran along his own trajectory.
As for the Polish cryptologists themselves — after Poland’s occupation, they evacuated through Romania to France, where they continued their work under Bertrand at the Cadix center in southern France. Jerzy Różycki died on 9 January 1942 — the ship on which he was returning from Algeria to France sank in the Mediterranean. After the fall of Vichy, Rejewski and Zygalski fled through Spain — where they were interned — to Britain, but were not admitted to work at Bletchley Park, for reasons of secrecy. They spent the rest of the war working on less significant ciphers in a Polish unit attached to the British armed forces.
After the war, Marian Rejewski returned to Poland. He worked as an accountant. The man who, at twenty-seven, had made one of the century’s greatest cryptanalytic breakthroughs kept the books at an enterprise in Bydgoszcz. The world learned of his work at Biuro Szyfrów only in the 1970s, when British archives began to be partially declassified and Rejewski himself wrote his memoirs. He died on 13 February 1980 in Warsaw, a few years before his name became widely known.
It is hard for me not to think about the scale of that mismatch. Seven years of work — from 1932 to 1939 — fit into three days of handover in woods outside Warsaw. Those three days gave the Allies the language in which they learned to read German secrets. And then the country that created that language was divided between Germany and the Soviet Union, and its mathematicians became refugees.
The story of Pyry is not the story of a lone genius. Rejewski worked in a team with Różycki and Zygalski. He was supported by officers Pokorny, Ciężki, and Palluth. Bertrand and, without knowing it, Schmidt passed him critically important documents. AVA’s engineers built his machines. And Turing, Welchman, and thousands of Bletchley Park staff made use of the results of his work. It is a chain in which every link is necessary — and you cannot remove the Polish link without destroying the whole construction. When Rejewski was asked after the war how he had broken Enigma, he replied that he had applied standard permutation theory — and that any mathematician in his place would have done the same. There was probably more politeness than truth in that: for some reason, “any mathematician” had not done it in either France or Britain until Warsaw handed them the finished answer.