Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enigma Rota Wiring Tables - Off by one #634

Closed
kevthehermit opened this issue Sep 10, 2019 · 2 comments
Closed

Enigma Rota Wiring Tables - Off by one #634

kevthehermit opened this issue Sep 10, 2019 · 2 comments
Assignees

Comments

@kevthehermit
Copy link

kevthehermit commented Sep 10, 2019

The rotor wiring tables in the Enigma Decoder are different to those published in other sources.

For example:
The Reflector Settings for B in Cyberchef (https://github.com/gchq/CyberChef/blob/master/src/core/lib/Enigma.mjs#L37) are
{name: "B", value: "AY BR CU DH EQ FS GL IP JX KN MO TZ VW"}

However Wikipedia (https://en.wikipedia.org/wiki/Enigma_rotor_details) and other sources like the python enigma library (https://bitbucket.org/bgneal/enigma/src/default/enigma/rotors/data.py) list this sequence as:

YRUHQSLDPXNGOKMIEBFZCWVJAT

This seems to be the case for the Reflectors and the Stepping Value for each Rotor

For example in CyberChef Rotor V has a stepping Value of A whilst the other sources list this as Z

This difference means that anything encoded with an external library is not compatible with cyberchef.

Can anyone offer any guidance on who is correct here?

Thanks

@n1474335
Copy link
Member

I'll let @s2224834 answer this more fully, but please see the following from the wiki article:

Enigma rotor and reflector settings are from GCHQ's documentation of known Enigma wirings. We currently simulate all basic versions of the German Service Enigma; most other versions should be possible by manually entering the rotor wirings. There are a few models of Enigma, or attachments for the Service Enigma, which we don't currently simulate. The operation was tested against some of GCHQ's working examples of Enigma machines. Output should be letter-for-letter identical to a real German Service Enigma. Note that some Enigma models used numbered rather than lettered rotors - we've chosen to stick with the easier-to-use lettered rotors.

@s2224834
Copy link
Contributor

For the reflectors, this is just a case of a slightly different format. Since the reflector can only swap pairs of letters, we're using the same paired syntax for the reflector as for the plugboard settings - i.e. for the reflector B, A and Y will be switched, and so forth. If you look at your listing which is using the rotor-style format, you have Y in the A position and A in the Y position, and so on. There are things you can encode with the rotor-style format that aren't actually valid reflectors because of that pairing constraint, so the choice of pairing syntax makes it clearer what's going on.

(To be entirely pedantic, there is a generalised version of this syntax for rotors, but instead of pairs of letters you have arbitrary-length cycles.)

For the stepping points, again it's really just a stylistic choice. The Wikipedia article you linked, for example, lists Z (for rotor V) but also notes that "If rotor steps from Z to A, the next rotor is advanced". This other Wikipedia page on the other hand lists A for rotor V, as we use. It also helpfully lists the mnemonic used at Bletchley Park to remember these. We've followed the same style as BP did, for reasons that should probably be obvious!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants