No history yet

Feistel Network Architecture

The Feistel Network

The Data Encryption Standard (DES) is a symmetric-key block cipher, and its internal structure is a classic example of a Feistel network. This design operates on a fixed-size block of data, in this case, 64 bits of plaintext. The process begins by splitting this 64-bit block into two equal halves: a 32-bit left side (L0L_0) and a 32-bit right side (R0R_0).

These two halves then go through a series of transformations called rounds. DES, for instance, uses 16 rounds. In each round, the data is scrambled using a round-specific key derived from the main encryption key. The magic of the Feistel structure lies in how it mixes these two halves together, creating a complex result that is difficult to reverse without the correct key.

A Single Round

The core of the Feistel cipher is its round function. In every round, one half of the data is modified by a complex function, and the result is then combined with the other half. Specifically, the right half (Ri1R_{i-1}) is put through a scrambling function, FF, along with a round key, KiK_i. The output of this function is then combined with the left half (Li1L_{i-1}) using an XOR operation. This becomes the new right half (RiR_i).

Meanwhile, the original right half (Ri1R_{i-1}) simply becomes the new left half (LiL_i). This swapping of halves ensures that in the next round, the portion of data that was just modified gets to influence the other half. This process repeats for all 16 rounds, with a different subkey used each time.

The logic for a single round can be expressed with two simple equations.

Li=Ri1Ri=Li1F(Ri1,Ki)\begin{aligned} L_i &= R_{i-1} \\ R_i &= L_{i-1} \oplus F(R_{i-1}, K_i) \end{aligned}

Reversible by Design

The true elegance of the Feistel network is its symmetry. The exact same process used for encryption can also be used for decryption. The only difference is that the round keys (K1,K2,...,K16K_1, K_2, ..., K_{16}) are applied in the reverse order.

This reversibility is possible because of the properties of the XOR operation. XOR is its own inverse, meaning that if you XOR a value with something twice, you get the original value back. For example, ABB=AA \oplus B \oplus B = A.

Knowing the outputs of a round, LiL_i and RiR_i, we can easily find the inputs, Li1L_{i-1} and Ri1R_{i-1}.

First, we can find the previous right half because of the swap:

Ri1=LiR_{i-1} = L_i

Next, we can find the previous left half by rearranging the second equation. We just need to XOR the new right half, RiR_i, with the output of the round function again.

Li1=RiF(Ri1,Ki)L_{i-1} = R_i \oplus F(R_{i-1}, K_i)

This remarkable property means that you don't need to design and implement a separate decryption algorithm. The same hardware or software can handle both encryption and decryption, making the Feistel network an efficient and clever design for symmetric ciphers.

Quiz Questions 1/6

What is the block size of the plaintext that the Data Encryption Standard (DES) operates on?

Quiz Questions 2/6

What is the primary advantage of using a Feistel network in a symmetric cipher like DES?