Close

Enigma Algorithm Closer to being figured out.

A project log for Mystery 6502 program for the Kim Uno #1kBChallenge

The #1kBChallenge inspired me to dust off the Kim-Uno and write an Enigma Z30 simulator. This is a very rare numbers only Enigma Machine.

arduino-enigmaArduino Enigma 12/04/2016 at 04:520 Comments

When writing assembly code, the end goal should be very clearly defined. I am trying to write the enigma algorithm for the Z30 machine as a series of additions, subtractions and table lookups.

I already have the rotors written as lookup tables in the format listed below. For example, pin 0 on the right is connected to pin 9 on the left. Pin 1 on the right is connected to pin 6 on the left.

9 6 4 1 8 2 7 0 3 5

The next step is to figure out an algorithm to convert the entry key to a lookup index. The algorithm is shown in the top right corner of the image below and it will turn a key into an index. This index will then be used to lookup the specific output for the rotor selected. In the example listed below, the rotor is showing the value 3 in the window and internally the ring setting is set to 5, the 1 index mark on the inner movable rotor is set to 5 on the visible numbers. If key 7 is pressed, it is equivalent to entering that rotor from pin 6. In the example rotor listed above, this will result in coming out on the left side on pin 7. Repeat for the remaining rotors, go into the reflector and go back through the rotors and the output value (guaranteed to never be 7) will be determined.

Discussions