How one construction solved an old encryption problem — and became the basis of DES, Russia’s Magma, and dozens of other algorithms
To decrypt a block cipher you have to somehow undo whatever scrambling encrypted it. Coming up with one good scrambling function is hard enough. Coming up with a clean mathematical inverse as well, and implementing both, doubles the work — and doubles the chances of getting something wrong.
In the early 1970s at IBM, Horst Feistel proposed a structural trick: cut the data block in half into L and R, run one half — together with a round key — through a function F that can be as complicated and irreversible as you like, add the result to the other half, then swap the halves. Repeat several times.
Broken down into steps, the whole construction turns out to be surprisingly simple:
The data block is cut in half into a left half L and a right half R. In DES that’s 32 and 32 bits out of a 64-bit block; in the Ludus Lab game it’s 4 and 4 bits out of a single byte.
The right half R is combined with this round’s subkey and run through function F — in DES and Magma that’s a set of S-boxes, substitution tables, which give the cipher its non-linearity.
F’s result is XORed with the left half L, producing the new right half. Then the halves are swapped.
The whole thing repeats over and over, each time with a new subkey: 16 times in DES, 32 times in Magma. More rounds make it harder to find any pattern between plaintext and ciphertext.
After the last round the halves are swapped one more time — and this is what gives a Feistel network its main property: to decrypt, Bob runs the exact same algorithm, just feeding in the subkeys in reverse order.
F can be as complicated and irreversible as you like — it’s the "split, mix, swap" scheme itself that is reversible.
Feistel’s idea didn’t stay theoretical — a large share of 20th-century symmetric cryptography is built on it:
The first cipher built on a Feistel structure, created by Horst Feistel and his team at IBM.
The direct ancestor of DES
A refined Lucifer became the US standard for a quarter century — a 64-bit block, a 56-bit key, 16 rounds.
Key: 56 bits — not enough today
An independent Soviet design on the same idea: a 64-bit block, but a 256-bit key and 32 rounds.
Today: GOST R 34.12-2015
The Feistel scheme turned out to be so successful that it became the basis of several more generations of ciphers:
In the Ludus Lab interactive demo you can:
Both algorithms are Feistel networks, but at very different scales and with very different fates:
| Parameter | DES | Magma (GOST 28147-89) |
|---|---|---|
| Country of origin | USA | USSR / Russia |
| Year adopted | 1977 | 1989 (today GOST R 34.12-2015) |
| Architecture | Feistel network | Feistel network |
| Block size | 64 bits | 64 bits |
| Key length | 56 bits | 256 bits |
| Number of rounds | 16 | 32 |
| S-boxes | Fixed by the standard since 1977 | Originally an agency secret; a single fixed set only arrived in 2015 |
| Regulator | NIST (USA) | FSB of Russia |
In 1990, cryptographers Eli Biham and Adi Shamir published differential cryptanalysis, a powerful attack on block ciphers. The community was stunned: DES’s S-boxes turned out to already be remarkably resistant to exactly this attack.
The explanation came later: according to IBM engineer Don Coppersmith, IBM’s team had known about differential cryptanalysis since the early 1970s and deliberately designed DES’s S-boxes to resist it — but at the NSA’s request kept it secret for nearly two decades.
A 56-bit DES key has about 7×1016 possible values — plenty in 1977. By 1998 the Electronic Frontier Foundation had built a dedicated machine, "Deep Crack," costing about $250,000, that found a key by brute force in roughly 56 hours.
That publicly proved 56 bits was no longer enough. The stopgap was 3DES (DES applied three times), followed in 2001 by AES, chosen through an open international competition.
Open, patent-free alternatives to DES, designed by Bruce Schneier in the 1990s
A joint development by Japanese companies, an international ISO/IEC standard, used in TLS
A Feistel network at the core of the 3G/UMTS confidentiality algorithms
Now you understand why the function F doesn’t have to be invertible, and how that one idea grew into DES, Magma, and dozens of other ciphers
In the demo you’ll walk a single byte all the way from plaintext to ciphertext and back — and see exactly why this structure works