Feistel cipher
In cryptography, a Feistel cipher is a symmetric structure used in the construction of block ciphers, named after the German IBM cryptographer Horst Feistel; it is also commonly known as a Feistel network. A large set of block ciphers use the scheme, including the Data Encryption Standard
The Feistel structure has the advantage that encryption and decryption operations are very similar, even identical in some cases, requiring only a reversal of the key schedule. Therefore the size of the code or circuitry required to implement such a cipher is nearly halved.
Feistel construction is iterative in nature which makes implementing the cryptosystem in hardware easier.
Feistel networks and similar constructions are product ciphers, and so combine multiple rounds of repeated operations, such as:
- Bit-shuffling (often called permutation boxes or P-boxes)
- Simple non-linear functions (often called substitution boxes or S-boxes)
- Linear mixing (in the sense of modular algebra) using XOR to produce a function with large amounts of what Claude Shannon described as "confusion and diffusion".
Bit shuffling creates the diffusion effect, while substitution is used for confusion.
Theoretical work
Many modern symmetric block ciphers use Feistel networks, and the structure and properties of Feistel ciphers have been extensively explored by cryptographers. Specifically, Michael Luby and Charles Rackoff analyzed the Feistel block cipher construction, and proved that if the round function is a cryptographically secure pseudorandom function, with Ki used as the seed, then 3 rounds is sufficient to make the block cipher a pseudorandom permutation, while 4 rounds is sufficient to make it a "strong" pseudorandom permutation (which means that it remains pseudorandom even to an adversary who gets oracle access to its inverse permutation).[1] Because of this very important result of Luby and Rackoff, Feistel ciphers are sometimes called Luby-Rackoff block ciphers. Further theoretical studies generalized the construction, and defined more precise limits for security.[2]
Construction
Let [math]\displaystyle{ {\rm F} }[/math] be the round function and let [math]\displaystyle{ K_1,K_2,\ldots,K_{n} }[/math] be the sub-keys for the rounds [math]\displaystyle{ 1,2,\ldots,n }[/math] respectively.
Then the basic operation is as follows:
Split the plaintext block into two equal pieces, ([math]\displaystyle{ L_1 }[/math], [math]\displaystyle{ R_1 }[/math])
For each round [math]\displaystyle{ i =1,2,\dots,n }[/math], compute (calculate)
- [math]\displaystyle{ L_{i+1} = R_i\, }[/math]
- [math]\displaystyle{ R_{i+1}= L_i \oplus {\rm F}(R_i, K_i) }[/math].
Then the ciphertext is [math]\displaystyle{ (R_{n+1}, L_{n+1}) }[/math]. (Commonly the two pieces [math]\displaystyle{ R_n }[/math] and [math]\displaystyle{ L_n }[/math] are not switched after the last round.)
Decryption of a ciphertext [math]\displaystyle{ (R_n, L_n) }[/math] is accomplished by computing for [math]\displaystyle{ i=n,n-1,\ldots,1 }[/math]
- [math]\displaystyle{ R_{i} = L_{i+1}\, }[/math]
- [math]\displaystyle{ L_{i} = R_{i+1} \oplus {\rm F}(L_{i+1}, K_{i}) }[/math].
Then [math]\displaystyle{ (L_1,R_1) }[/math] is the plaintext again.
One advantage of this model is that the round function [math]\displaystyle{ {\rm F} }[/math] does not have to be invertible, and can be very complex.
The diagram illustrates the encryption process. Decryption requires only reversing the order of the subkey [math]\displaystyle{ K_{n},K_{n-1},\ldots,K_1 }[/math] using the same process; this is the only difference between encryption and decryption:
Unbalanced Feistel ciphers use a modified structure where [math]\displaystyle{ L_1 }[/math] and [math]\displaystyle{ R_1 }[/math] are not of equal lengths. The MacGuffin cipher is an experimental example of such a cipher.
The Feistel construction is also used in cryptographic algorithms other than block ciphers. For example, the Optimal Asymmetric Encryption Padding (OAEP) scheme uses a simple Feistel network to randomize ciphertexts in certain asymmetric-key encryption schemes.
List of Feistel ciphers
Feistel or modified Feistel: Blowfish, Camellia, CAST-128, DES, FEAL, ICE, KASUMI, LOKI97, Lucifer, MARS, MAGENTA, MISTY1, RC5, TEA, Triple DES, Twofish, XTEA, GOST 28147-89
Generalised Feistel: CAST-256, MacGuffin, RC2, RC6, Skipjack