Enigma Machine Settings

This page briefly describes the Enigma Machine and the settings that can be changed. This article is not a comprehensive explaination on how the Enigma Machine works.
For some information about the Enigma, see these articles and videos (they're also my sources):

Enigma Machine Translation

There are 4 parts to an Enigma Machine encryption
  • A rotor: each rotor maps characters in a specific way. They can be rotated (hence the name rotors) and switched with other rotors.
  • A reflector: a reflector is like a rotor but it does not rotate. They can also be switched around.
  • A plugboard: a plugboard maps each letter to another. The person setting up the Enigma machine chooses the mappings.
A translation goes through plugboard, rotor 3, rotor 2, rotor 1, reflector, rotor 1, rotor 2, rotor 3, and then plugboard
The rotor 3 rotates before each translation and when rotor 3 completes a full turn, it rotates rotor 2 by one. Similarly when rotor 2 completes a full turn it pushes rotor 1. These are two translations:

Parts

Rotors

The Enigma Machine (M3 Army version) has three slots for rotors. Each slot can take one of these rotors:
Rotor name Rotor mapping
I
II
III
IV
V
VI
VII
VIII
When a letter gets send to the rotors A letter first goes through the rotors at position 1 then the one at position 2 then the one at position 3. Then it passes through the reflector and goes through the rotors again in reverse order (1 followed by 2 followed by 3)

Reflector

Reflector name Mapping
Reflector A
Reflector B
Reflector C

Plugboard

Any two letters can be paired together

Syntax of settings

Settings for a particular part of the machine are specified between < and >.
Different parts can be separated by spaces, tabs, or newlines. Newer settings completely override older ones (even plugboard settings)

Rotors

A rotors is specified with < name of rotor : position : starting rotation >. Where
  • name of rotor: the name of the rotor to place in. Has to be one I, II, III IV, V, VI, or VII
  • position: the position in the machine. Must be between 1 and 3 (inclusive)
  • starting rotation: the starting rotation of the new rotor. Has to be a capital letter

Reflector

A reflector is specified with < reflector name > where reflector name is one of Reflector A, Reflector B, or Reflector C.

Plugboard

The plugboard is specified with < (c1, c2) (c3, c4) ... >. Where
  • (c1, c2) is a pair of (uppercase) characters. A character should only appear once in the part

Implementation Details

Enigma settings can be represented by a regular language so the parser is simply this DFA implementation.
Last updated: August 2015 by John Rizkalla