question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enigma M4 gives wrong encryption for some rotor settings

See original GitHub issue

When the Enigma M4 is set to use reflector UKW B thin and 4th rotor Beta in position A, ring A, the encryption should be identical to that of the M3 set to reflector UKW B. See https://www.cryptomuseum.com/crypto/enigma/m4/index.htm in section “Zusatzwalze Beta (β) and Gamma (γ)”.

Cryptii works correctly in this setting for some rotor combinations. By accident, I discovered that it fails to work with certain combinations. I did not notice any particular pattern. In the examples below, I merely changed Rotor 2 from II to I.

Steps to reproduce the bug

  1. See correct behavior: https://cryptii.com/pipes/D3cegA
  2. See incorrect behavior: https://cryptii.com/pipes/PYzXOQ

Describe what you expected to happen Output text in the 2nd example should be the same as the input.

Version, environment and state Tried with Chrome and Firefox, same behavior on both.

Inside the web app press Ctrl+I, copy the presented alert text and paste it into the block below.

{"version":"4.0.8+master.8ae346e","env":{"name":"firefox","version":"81.0.0","os":"Linux","type":"browser"},"pipe":{"id":1032640313,"url":"https://cryptii.com/pipes/PYzXOQ","title":"The Enigma machine: Encrypt and decrypt online","description":"The Enigma cipher machine is well known for the vital role it played during WWII. Alan Turing and his attempts to crack the Enigma machine code changed history. Nevertheless, many messages could not be decrypted until today.","items":[{"name":"text","title":"Plaintext"},{"name":"enigma","settings":{"model":"M4","reflector":"UKW-B-thin","rotor1":"beta","position1":1,"ring1":1,"rotor2":"I","position2":17,"ring2":3,"rotor3":"III","position3":12,"ring3":5,"rotor4":"I","position4":2,"ring4":2,"plugboard":"bq cr di ej kw mt os px uz gh","includeForeignChars":false}},{"name":"enigma","settings":{"model":"M3","reflector":"UKW-B","rotor1":"I","position1":17,"ring1":3,"rotor2":"III","position2":12,"ring2":5,"rotor3":"I","position3":2,"ring3":2,"plugboard":"bq cr di ej kw mt os px uz gh","includeForeignChars":false}},{"name":"text"}],"content":{"data":"intel ligen cepoi ntsto attac konth eeast wallo fthec astle atdaw n"}}}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ffraenzcommented, Oct 14, 2020

Again, thank you for taking the time to report this issue. This was a very interesting edge case bringing the Enigma machine simulation closer to its physical counterpart.

0reactions
the-lambda-waycommented, Oct 14, 2020

It’s resolved on my end. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enigma details - Cipher Machines and Cryptology
When changing the ring setting one position, the encryption is shifted one position. The rotor turnover point remains at the same letter, because...
Read more >
Enigma - Crypto Museum
This principle is called Enigma stepping and has the strange side-effect that the middle rotor steps twice (on two successive key presses) if ......
Read more >
enigma cipher machine simulator 7.0.5
To encrypt a message, the operator had to select a random start position for the rotors, the so-called message key, which had to...
Read more >
Why didn't Allied code breakers attempt to intercept the rotor ...
Leaving the reflector off makes the encryption asymmetrical - more difficult to decrypt, but also gets rid of the most profound weakness, never...
Read more >
How cryptographically secure was the original WW2 Enigma ...
Security of Enigma depended on wiring of rotors, ... I'll skip the details and simply give you some raw numbers while summing up...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found