matheusportela / enigma-machine

Enigma machine simulator in JavaScript for didactic purposes.
MIT License
37 stars 10 forks source link

Apply rotor step before executing encoding #2

Closed matheusportela closed 8 years ago

matheusportela commented 8 years ago

Extracted from Technical Details on the Enigma Machine

Remember that, when depressing a key, the rotors advance before the electrical signal runs through the rotors. Therefore, to examine the current flow through the rightmost rotor in A position, the rotor must be set in the Z position before depressing the key (this also counts for the other rotors if they are due to step). In the examples above, no plugs are set on the plugboard and the signal runs directly from the A key, through the entry rotor, to rotor I.

Currently, stepping is applied after running the letter encoding