Was the alphabet scrambled on Enigma rotors?

This is a pretty good video on the operation of the Enigma machine, but I think I missed one part:

He mentions that they would select three out of five possible rotors containing 26 letters. So there had to be some difference in the rotors, or else it wouldn’t matter which three were selected. How did the rotors differ while there just sitting in a box waiting to be selected?

Each rotor input could be wired to one of 26 rotor outputs. The different rotors had different arrangements of wiring inside.

Can’t remember the details, but was it really only 25 different possible outputs? I know that no letter could be finally encoded as itself, but not sure if this applied to individual rotors.

The reason that a letter could not be encoded as itself is because the circuit path actually went back and forth through the set of three rotors. So you’d type a letter and it would go through the first, second, and third rotor, then through a “reflector” disc which IIRC did not move, and back through a different route through the third, second, and first rotor. Therefore a given input letter would necessarily appear as a different output letter on the first rotor.

Here is a nice diagram from Wikipedia.

So Enigma is nothing more than an elaborate substitution cipher? I thought it used a more complex principle than that.

Yes, it’s basically a polyalphabetic substitution cipher.

The point is, though, that the substitution code changes after each letter (as the rotor advances), which gets round the obvious flaw in substitution ciphers: letter frequency analysis.

Right. I recall the operation now.

The mapping from one letter to another letter changed each letter as the rotors advanced. So it was not really a substitution chiper.

Some good videos about the enigma machine

About how the machine works.

How the flaw that a letter could not be encoded as itself enabled the allies decode enigma transmissions.

It was, just not a simplistic mono-alphabetic one. Another, much simpler, polyalphabetic substitution cipher is the Vigenere cipher, in which you choose a keyword and basically repeat it over and over and "add " the plaintext with the keyword text to get the cipher text. It’s actually not all that difficult to crack, given a long enough message (although it was considered impossible to crack for a few hundred years), even though it seems like it should be.

There were rotors with 26 positions so the length of the key phrase was 262626 or 17576 characters before things started to repeat. So the keywords were pretty long but there were not 26^17576 possible keywords. There were 5 possible rotors that you could put into the three positions. You could choose 26 starting positions for each rotor. So I think that works out to 1054560 possible keywords.

Additionally there was a plugboard in the front that acted like a substitution cipher on top of the changing one from the rotors. This stayed constant for the message.

Yes. That’s what I would call a type of polyalphabetic substitution cipher. It’s complex, yes, but it’s one for one letter substitution using a different “alphabet” for each letter.