# Could the Enigma algorithm be classified as a Feistel network?

The Enigma algorithm is a encryption method that was developed (I believe) by the Germans in WWII. It went a little something like this:

When a letter was typed on the keyboard of the Enigma machine, it was first sent through the first rotor, which would shift the letter according to its present setting. The new letter would then pass through the second rotor, where it would be replaced by a substitution according to the present setting of the second rotor. This new letter would in turn pass through the third rotor, again being substituted accordingly. Next, this new letter would be bounced off of a reflector, and back through the three rotors in reverse order. The trick that made Enigma so powerful for its time though, was the spinning of the rotors. As the plain text letter passed through the first rotor, the first rotor would rotate one position. The other two rotors would remain stationary until the first rotor had rotated 26 times (the number of letters in the alphabet and therefore, one full rotation). Then the second rotor would rotate one position. After the second rotor had rotated 26 times (26X26 letters, since the first rotor has to rotate 26 times for every time the second rotor rotates), the third rotor would rotate one position. The cycle would continue like this for the entire length of the message. The result was a shifting shift. In other words, an s could be encoded as a b in the first part of the message, and then as an m later in the message. This principle of the shifting rotors allowed for 26X26X26 = 17576 possible positions of the rotors.

In order for the recipient to decode the message, they would need to know the initial settings of the rotors, and then put the cipher text through the machine to find the plain text. The Germans devised a system by which all of the recipients would set their rotors to predetermined settings according to the date. Each clerk had a book detailing the settings for each day.

Although (I believe) a true Feistel involves splitting into two halves (which doesn't happen here) and where one old half == other new half after a round of encryption, could this algorithm be classified as a Feistel network?

-

## migrated from security.stackexchange.comOct 2 '12 at 15:03

This question came from our site for information security professionals.

FYI Actually it was built before the war for commercial businesses and then adopted by the army. Very cool story on how it was developed :) – Lucas Kauffman Oct 2 '12 at 15:07
Also FYI The trick that made enigma so powerful was not the rotators changing position (since that was common of rotor machines of that time period hence the term rotor), it was the reflector that reflected the character back through the rotors. see en.wikipedia.org/wiki/Enigma_machine#Reflector The reflector also introduced a weakness into enigma. Namely that a character could never be encoded by itself. – Ethan Heilman Oct 2 '12 at 20:15
@Ethan Heilman: Even the Kriegsmarine's Enigma with four rotors was poor encryption without the Stecker-board. What made it powerful was adding the Stecker-board's configuration to the initial state of the machine. – bob Oct 12 '12 at 12:17
@bob - Yep you are correct. I had always heard that the reflector was unique to enigma (since the germans patented it) and assumed the plugboard while necessary to security was a rather common feature on rotor machines at that time. Researching this further I realize I was wrong, reflectors were quite common (for example the M-325 had a reflector) but I can find no mention of plug boards prior to the enigma (although that doesn't mean there were none). quadibloc.com/crypto/ro020404.htm – Ethan Heilman Oct 12 '12 at 20:06

No, it's a rotor machine and more importantly, a stream cipher that operates on a character-by-character basis.

Block ciphers operate on a chunk at a time. Feistel ciphers are a way to construct block ciphers. We could talk more about Feistel ciphers or more basically block ciphers, but that's not your question.

At its most basic, Enigma is a stream cipher as opposed to a block cipher.

Jon

-
Every position of the wheels (plus the Stecker-board) defines a unique mono-alphabetic substitution, that has no fixed points and is self-inverse. It's applied to one letter and then one wheel moves, sometimes triggering another wheel movement as well. We then get the next monoalphabetic etc. After all wheels have gone full circle, the cipher returns to the initial state (but this never happened in practice, as messages were shorter than the cycle length). Indeed a very different structure. – Henno Brandsma Oct 2 '12 at 20:40
@Jon Callas: It's not really a stream cipher (although there is no perfect definition for it, the vast majority of stream ciphers produce a key stream symbols and then combine then with plaintext symbols). The Enigma rather embodies a polyalphabetic cipher with a very large period (as described by Henno Brandsma). – bob Oct 12 '12 at 12:14
@bob, I would disagree. Ciphers are classified as being either stream or block and I think we all agree that it's not a block cipher. Even a simple substitution cipher is a stream cipher - just not a very secure one. – John Deters Oct 22 '12 at 19:51
@JohnDeters: I'd be interested in your definition of a stream cipher and a block cipher then. (You might have noted the caveat in my previous comment that the view I have of a stream cipher might not be universally recognized; but at least I gave one.) – bob Oct 22 '12 at 20:01
Stream ciphers operate on characters, or arguably even bits in a stream. For Enigma, it's characters. Binary ones like Lorentz or RC4 can be thought to work on bits. Engima takes a character, rattles it around a path and it goes to another character map. (And the wheels ratchet one place.) Computer stream ciphers are a PRNG that is XORed onto the plaintext to yield ciphertext. Block ciphers take a binary block and the key giving another block. That's it. We use chaining modes to encrypt more than one block, but it works on blocks. It is a mapping of input blocks of bits to output blocks. – Jon Callas Oct 24 '12 at 1:01

Enigma is not a Feistel cipher. A "Feistel cipher" is a block cipher with a specific structure, namely the whole business with the two halves, the combination of one half with a (one-way) function of the other half and a reversible operation (e.g. XOR), and the swap. See the Wikipedia page which has nice schematics.

So considering Enigma as a kind of Feistel cipher is like considering a salmon as a kind of chicken: yeah, it has no beak, no feathers, no legs and no wings, but could it be a called a chicken ? Strangely enough, I tend to answer no to that. Even though both the salmon and the chicken are edible. But being edible is not sufficient to grant chickenness. Similarly, being a symmetric cipher is not sufficient to grant Feistelness.

-
What about something such as MD5 or the TwoFish algorithm? – SwaroopGiwali Oct 2 '12 at 15:29
Twofish is a Feistel variant (it has a few extra elements such as word rotations, but the basic Feistel structure is there). MD5 is not even a symmetric cipher; however, it is possible to say that the core of the "compression function" in MD5 is akin to a generalized Feistel structure, albeit with the message and key swapping their roles. This kind of stretches the limits of the terminology. – Thomas Pornin Oct 2 '12 at 15:39
+1 for the analogy. :) – Ilmari Karonen Oct 4 '12 at 15:11
[+1] for the "…not sufficient to grant chickenness." [ROFL] – e-sushi Aug 27 '13 at 7:32