Enigma M3: middle rotor II + rigtmost rotors V..VIII produces wrong results
Dreamoochy opened this issue · 3 comments
It seems there is an issue with the roror II in Enigma tool.
Steps to reproduce:
- Open Practical Cryptography's Enigma tool
- Set the following values:
Plaintext: SOMESECRETMESSAGE
key settings: VEZ
ring settings: ABD
Rotors: 324
Plug board settings: GT YC EJ UA RX PN IS WB MH ZV
- Press
Encrypt/Decrypt
- Copy
cipertext
value to Dencode Enigma tool - Configure Dencode Enigma tool with the above mentioned settings. (Reflector UKW-B)
Result: message is decrypted correctly.
- In the Practical Cryptography's Enigma tool set rightmost rotor to 5 (to be 325)
- Repeat steps 3-4
Result: message is decrypted incorrectly.
- In the Practical Cryptography's Enigma tool set middle rotor to 3 (to be 335)
- Repeat steps 3-4
Result: message is decrypted correctly.
So it seems that combinations of the middle rotor II + rightmost rotors V..VIII produce incorrect results.
I've also tested CacheSleuth tool, and it behaves like Practical Cryptography's one, i.e. it has no such issue.
P.S. Thanks to @the-lambda-way
This also has to do with the position / key settings. If you set the rotors to 325 with positions / key VDZ instead of VEZ, then DenCode agrees with Practical Cryptography. Note that rotor II has a turnover notch at E and rotor V has a notch at Z, so this might be related to this comment on Practical Cryptography. I've noticed issues with many Enigma tools when it comes to double stepping, and I'm not sure what the correct behavior actually is in this special case.
The behavior is certainly different.
I implemented Enigma as a separate project. The implementation for double stepping is below.
This implementation is based on cryptomuseum.com.
I'll look into it, but if you find anything please let me know.
According to this comment pointed out by @the-lambda-way, the behavior of DenCode seems to be fine. I also checked on Universal Enigma and cryptii, but they are the same as DenCode.
Practical Cryptography's Enigma tool and CacheSleuth use almost the same JavaScript code. Based on the behavior, they may be stepping the middle rotor twice at once.