# What was the key length of the Enigma?

When I type in any plaintext to an Enigma machine (Enigma machine emulator) the substitution does not seem to follow any pattern. In other words, there is no cycle in the use of enciphering alphabets (defined as the number of switches done when turning a plaintext letter to a ciphertext letter - which can vary from 0 to 26).

But since the key is the alignment of the rotors, there must be a finite key length even though it probably is longer than any plaintext ever would be. I imagine if you keep writing long enough, the rotors will eventually align in a way they already were. If I'm right - how long is the key?

And if the key is much longer than any plaintext, wouldn't that mean the Enimga is a one-time pad? From what I can read, the OTP is defined as an algorithm with a key longer than the plaintext. Is this wrong?

• The key length (measured in bits) is the base-2 logaritm of the number of settings (that are not equivalent, but there are no known equivalent settings in Enigma). Therefore the question reduces to counting the number of settings, which is asked and answered there, then taking a base-2 logarithm, which is trivial. It leads to about 67.1 bits for the Enigma M3 and the basic setup procedure. – fgrieu Mar 11 at 11:04
• Or are you asking when the state of the Enigma machine loops back to its initial state ? – fgrieu Mar 11 at 14:41
• Are you asking about: A) the key length of Enigma? The key length (measured in bits) is the base-2 logarithm of the number of settings. Therefore the question reduces to counting the number of settings, which is asked and answered there, then taking a base-2 logarithm, which leads to about 67.1 bits for the Enigma M3 and the basic setup procedure. Or B) after how many encrypted letters the Enigma returns to its initial state, which is a different question? – fgrieu Mar 11 at 14:45
• @Kristian Francisco Milla Niels The OTP must have a key that is at least as long as the plaintext. It might be much longer than the plaintext. – Patriot Mar 11 at 15:13
• If I'm not mistaken the Enigma never encrypts a character onto itself. That means it directly leaks data (even if that's not anywhere near the plaintext message), and therefore it cannot be an OTP. Just having a long key doesn't make an OTP, it depends on the scheme. – Maarten Bodewes Mar 14 at 21:37