Crypto-IT Logo
ου γαρ εστιν κρυπτον ο ου φανερον γενησεται ουδε αποκρυφον ο ου γνωσθησεται και εις φανερον ελθη
Wersja PL ENG Version

Rotor machines

  • Description
  • Algorithm
  • Implementation
Electric rotor machines were mechanical devices that allowed to use encryption algorithms that were much more complex than ciphers, which were used manually. They were developed in the middle of the second decade of the 20th century. They became one of the most important cryptographic solutions in the world for the next tens of years.
Cryptographic rotor machines
The concept of using rotor machines in cryptography occurred to a number of inventors independently. At present, two Dutch naval officers, Theo A. van Hengel (1875 – 1939) and R. P. C. Spengler (1875 – 1955) are considered to invent the first rotor cipher machine in 1915. There were four more people who created (more or less independently) their own cryptographic rotor machines not much time later: Edward Hebern, Arvid Damm, Hugo Koch and Arthur Scherbius.

Electro-mechanical machines fitted with movable rotors were able to produce long random keystreams, thus allowing to encrypt messages by using polyalphabetic substitution ciphers.

The main idea that lies behind rotor machines is relatively simple. One can imagine a simple device, similar to a typewriter, with a number of keys used to input text. The number of keys may differ, however usually there are 26 to 32 characters.

Simple substitution cipher

Each keystroke produces an output character, depending of the internal construction of the machine. In the simplest case, if only wires are used (without any rotors), each input key will be mapped to one specific output character.

For example, if someone pressed K in the keyboard, the machine would always produce C.

As a result, the machine would encrypt the messages by using a simple substitution cipher.

Adding a rotor

Having a simple substitution machine, one can imagine adding an additional internal rotor with an internal wiring. The rotor will rotate with a gear, each time after a keystroke. As a result, after pressing the same letter twice, it will be encoded differently due to different internal wiring.

For example, if someone pressed KK in the keyboard, the machine would produce CB (because the wiring changed after the first keystroke, due to the rotor movement).

The internal wiring of the rotor should be kept secret, however we may expect that over time the enemy will discover its design. It will make it easier for them to break the cipher but it won't compromise the security altogether.

To decode a ciphertext the receiver would need a machine with the same rotor. Adding the rotor caused the encryption to become a stronger polyalphabetic substitution cipher.

Make it difficult

To improve the security, one could add more rotors. The output of one rotor would be connected to the input of the second rotor. Similarly, the second rotor output would be connected to the third one, and so on. The strength of the encryption depends on several factors:

Each rotor would contain a different internal wiring. The substitution performed by each rotor should be unknown for the enemy. To make cryptanalysis more difficult and to ensure that the wiring inside each rotor changes with different frequency, the discs should rotate with different speeds.

Additionally, depending on the design of the machine, some additional features may be added to the machine, to ensure that the produced substitution is as random as possible (for example, an additional fixed substitution that does not depends on the rotors).

Some rotor machines (most notably Enigma) were designed to be symmetrical. That means that encrypting the same message twice (with the same settings), would produce the original message.