1 Codes, Ciphers, and Cryptography-Ch 3.2 Michael A. Karls Ball State University
2 Main Ingredients of the Enigma Keyboard (with A-Z) Light bulbs (with A-Z) Plugboard (with A-Z) Rotors (with 0-25) Reflector (with 0-25)
3 User Interface The keyboard and light bulbs were the user interface for entering and reading messages. The plugboard was used to increase the number of keys (settings).
4 Rotors Each rotor was connected with a series of wires that created a permutation cipher. An electric signal would enter the rotor at one position and the permutation would cause the signal to leave at a different position on the far side of the rotor.
5 Reflector The reflector rotor at the end was a fixed product of disjoint two-cycles (i.e. a permutation), such as = (0, 12)(1, 9)(2, 3) (4, 24)(5, 18)(6, 23)(7, 8) (10, 25)(11, 13)(14, 21) (15, 17)(16, 19)(20, 22) Note that -1 = , so x = x for all x.
6 Mathematics of the Enigma If we ignore the plugboard settings, the Enigma is a product of permutations! x plain yz w a b c d cipher reflectorrotor 3rotor 2rotor 1
7 Mathematics of the Enigma (cont.)
8 Equation (1) is a model for the Enigma if we encrypt one letter! Recall that the rotors move like an odometer, with rotor 2 changing when rotor 1 changes from 25 to 0 and rotor 3 changing in a similar fashion.
9 Mathematics of the Enigma (cont.) To account for the rotation of the rotors, we introduce a “shift” variable for each rotor, which keeps track of how far a rotor has shifted from its initial position! Shift variables: s 1 rotor 1 s 2 rotor 2 s 3 rotor 3 Note: For s 2 to increase, we need s 1 to change from 25 to 0 and for s 3 to increase, we need s 2 to change from 25 to 0.
10 Mathematics of the Enigma (cont.) To account for the shift s 1, instead of computing we compute Instead of computing the inverse of to get x, i.e. we need to solve (2) for x in terms of y.
11 Mathematics of the Enigma (cont.) Applying 1 -1 to both sides of (2) yields: Adding - s 1 mod 26 to both sides of (3), We will use functions of form (2) and (4) to account for the moving rotors! To encrypt, we actually compute the following:
12 Mathematics of the Enigma (cont.)
13 Mathematics of the Enigma (cont.) After each letter, check shift variables (mod 26): s 1 = (s 1 + 1) mod 26 If s 1 = 0, then s 2 = (s 2 + 1) mod 26 If s 2 = 0, then s 3 = (s 3 + 1) mod 26
14 Example 1 Suppose we are given 1, 2, 3, and as follows: 1 = (0, 15, 7, 8, 19, 23) (1, 4, 17, 2) (3, 13, 25, 5, 21, 12) (6, 9, 10, 22, 11, 14, 24, 16, 18, 20) 2 = (0, 5, 9) (1, 2, 3, 7, 6, 8, 4) (10, 11, 12, 15, 18, 13, 14, 16, 19, 17) (20, 25, 22, 21, 24, 23) 3 = (0, 10, 20, 3, 13, 23, 7, 17, 5, 15, 25, 1, 11, 21) (2, 12, 22, 4, 14, 24, 8, 18, 9, 19, 6, 16) = (0, 12) (1, 9) (2, 3) (4, 24) (5, 18) (6, 23) (7, 8) (10, 25) (11, 13) (14, 21) (15, 17) (16, 19) (20, 22), with s 1 = 24, s 2 = 10, and s 3 = 5. Use these initial settings to encipher the message “Get your forces ready”.
15 Example 1 (cont.) Solution: Take x = 6 for G and compute with (5).
16 Example 1 (cont.)
17 Example 1 (cont.)
18 Example 1 (cont.)
19 Example 1 (cont.) Thus, d = 15, which implies G is encrypted as P. Finally, update shift variables. s 1 = (s 1 + 1) mod 26 = (24+1) mod 26 = 25 s 2 = 10 s 3 = 5 Repeat with x = 4 for E, … Homework: Finish enciphering message!
20 References for Enigma Notes and Photos D. W. Hardy and C. L. Walker, Applied Algebra, Codes, Ciphers, and Discrete Algorithms, Prentice Hall, New Jersey,