Ozzzy's Place
The Enigma Machine
When the Nazi's started rebuilding the German armed forces in the 1930's one of the things that they knew
needed to be done was to come up with a system to ensure that they had tight, secure communications networks.
There was a cipher machine available at the time commercialy known as the 'Enigma'; a rotor-based machine that
was thought to be unbreakable. This machine was the pattern for the family of cipher machines that the Germans
used to encipher their morse code communications throughout the war.
The Enigma family of machines can be characterised by the three rotor Army Enigma. This is the machine that
will be discussed here.
The Army Enigma was a three rotor cipher machine. It consisted of of keyboard for input, a lamp panel for output
and a plugboard. To set up the machine, the operators would first check their book of settings and setup the plugboard.
The plugboard consisted of twenty-six pairs of plugs. These could be connected by cables which would transpose
the two letters connected. For example, if A was connected to B then A and B were swapped during both input and
output. Generally ten pairs of letters would be swapped via the plugboard leaving six letters un-swapped.
Then the operators would setup the scrambler. There were (at first) five rotors that could be used in the Enigma
machine. The daily settings would tell the operators which three to use and in what order. The operator would
select the three rotors and set them on an axle in the correct order.
The rotors consisted of a wheel with twenty-six spring loaded contacts on the right side, and twenty-six milled contacts
on the left. These were cross-connected so that a signal entering at location 1 (A) might come out at location 14 (N). Each
rotor was wired differently. The rotor also had an alphabet ring which could be turned and locked by a spring-pin at any
location. So, on one day position 1 might be A... but change the position of the ring and 1 might now be Q.
The rotor worked thusly; a signal would pass through all the rotors and come to a reflector plate at the far left. This
acted as a half-rotor and would take the signal and map it to another pin. Then the signal would travel back through
the scrambler the other way until it returned to the lampboard. This meant two things. A letter could never be
encrypted as itself, and that for each rotor setting a letter and it's encrypted value were reversable. So, entering an
A at a certain setting might give you an X, and entering and X would give you an A.
This meant that the machine did not need to have seperate encrypt and decrypt modes. It also meant that anyone
wanting to break the code had a slight crack in which to wedge his intellectual crowbar. But back to the Enigma.
The operator would check his daily settings and set the alphabet rings on the three rotors accordingly.
Once the plugboard and scrambler were setup the machine was ready for use.
Using the Enigma
Here is a simplified version of how the Enigma was used to encrypt a message. First the operator would select
a three letter (say VIN) group at random and his assistant would select another (LJQ). The operator would turn the rotors so that
VIN was in the windows on the machine. Then he would type in the second three letter group
twice; LJQLJQ might give XPYUEV. He would then enter his three letter group, the base setting (Grundstellung) in the header
of the message. XPYUEV would be prepended to the message. He would then turn the
rotors so that the letters of the second group were in the windows and start encrypting his message. He would press
a key in the message (say A) and the assistant would read the letter that lit up on the lamp board (perhaps Z). Once
the whole message was done it was handed to the radio operator for transmission.
On receiving a message, the operator would look at the header and see the base setting of VIN. Having already setup his
plugboard and scrambler according to the daily settings he would turn the rotors so that VIN showed in the windows. Then he would
type the first six letters of the encrypted message XPYUEV and get LJQLJQ. The would turn the wheels so that LJQ appeared and
then decrypt the remainder of the message.
Your very own Enigma
I have written a few scripts that emulate the three rotor Enigma. These are in PERL and will function with little
change on any PERL enabled platform.
Another Enigma Emulator
An on-line Enigma Machine
Simple Enigma
Script
A set of scripts
that work as a complete system
A script to
automatically setup your Enigma
A script to
automatically create a daily key book
Look at the script itself