Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. New subscribers only. T&Cs apply

Find out more

Rejewski’s insight

Using the mathematical insights of permutations, Rejewski invented a device called a cyclometer that enabled him to infer the daily settings.
A part-finished jigsaw puzzle

Using the mathematical insights of permutations, Rejewski invented a device called a cyclometer that enabled him to infer the daily settings from listening in to the encrypted messages.

Rejewski’s cyclometer

Rejewski’s genius insight was to realise that even though there were 10,586,916,764,424,000 different ways of setting up an Enigma machine at the time, because (as we have just seen) the cycle structure is invariant under conjugation, there are only 105,456 different possibilities for the cycle structure. The contribution from the plugboard is irrelevant to the cycle structure of the permutation coming from “rotors on the first keypress” followed by “rotors on the fourth keypress”!

Rejewski invented his cyclometer to run through all possible rotor orders and ground settings, finding the cycle structure of the plugboard-free “double Enigma machine” that they induce. He would then compare this to the cycle structure discovered from listening in to the day’s encrypted traffic to infer the settings for the day.

As it happens, there’s not a unique answer for two 7-cycles, two 4-cycles and four 1-cycles. However, if you repeat the exercise for the permutation that sends the second letter to the fifth letter, and the permutation that sends the third letter to the sixth letter, this leads to a unique rotor order and starting position: rotors III,I,II with starting positions YRK.

Thus solely from listening in to the first six letters of the encrypted traffic, and using the mathematics of permutations (that cycle structure is invariant under conjugation), we have found the correct rotors and starting positions!

Deducing the plugboard settings

But what about the plugboard? After all, that’s the thing that provides all this combinatorial complexity.

Here we rely on humans not being good at randomness.

Recall one of the repeated trigram messages was MFK FXT. Let’s type that into a machine with correct rotors and starting positions (that is, with rotors III,I,II and ground setting YRK), but leaving the plugboard blank.

We would get out the following: QQQ QRB.

That strongly suggests to a cryptanalyst that maybe the original trigram was QQQ.

So we type QQQ QQQ into the plugboard-less machine and get MFK FOP. But we know from listening in to the encrypted radio signals that the real encrypted trigram should be MFK FXT.

The fifth letter strongly suggests that O and X are swapped in the plugboard, and the sixth letter suggests P and T are swapped in the plugboard. And if we look back at our settings, we see that we are correct. So we have deduced two of the six swaps already!

Doing a few more examples will yield the daily setting of

  • Rotors: III, I, II
  • Ground setting: YRK
  • Plugboard: CD GI HZ OX PT RY
© University of York
This article is from the free online

The Mathematics of Cryptography: From Ancient Rome to a Quantum Future

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now