The idea: split, mix one half, swap
A Feistel network is a way to build a block cipher out of a function that does not have to be reversible. The block is cut into a left half L and a right half R. Each round runs a round function F on the right half with a round key, XORs the result into the left half, and swaps the halves. DES, the Data Encryption Standard of 1977, is a Feistel network with 16 rounds.
One round
In symbols, round i computes
L_i = R_(i-1) R_i = L_(i-1) ⊕ F(R_(i-1), K_i)
The right half is copied unchanged to the left side. Only the left half is changed, and the change depends on the right half and the key. The canvas draws this as a ladder: the right half flies into F together with the round key, F's output flies to the ⊕ on the left line, and the two lines cross for the swap (Demo: encrypt one block, 4 rounds). The last round leaves out the swap, as DES does.
Decryption: the same network, keys reversed
To decrypt, put the ciphertext into the very same network and use the round keys in reverse order: K4, K3, K2, K1. Why it works: the first decryption round sees the half that the last encryption round left unchanged, so it computes the same F value, and XOR with the same value cancels it. Round by round, the encryption is peeled off: the F values come out in reverse order, B7, F1, 74, 58, and the rows are the encryption rows read upward (Demo: decrypt with the keys reversed). The order matters. Start with K1 and you get garbage, E183 instead of 4869 (Demo: decrypt with the keys in the wrong order).
Because F is only ever computed forward, it can be any mixing function at all. In DES it squeezes 48 bits into 32, so it can't be undone, and that does not matter. Hardware for DES also needs only one circuit for both directions.
The toy cipher on the canvas
The canvas runs a cipher small enough to read every bit. Its shape is the same as DES, but every part is smaller:
| Toy-16 (canvas) | DES | |
|---|---|---|
| Block | 16 bits: L and R of 8 bits | 64 bits: L and R of 32 bits |
| Key | 16 bits | 64 bits, of which 56 are used (8 are parity bits) |
| Rounds | 4 (the select allows 1–4) | 16 |
| Round keys | 8 bits: the first byte of the key rotated left by 4(i−1) | 48 bits: PC-1, rotations by 1 or 2, then PC-2 picks 48 of the 56 |
| F(R, K) | R ⊕ K, a 4-bit S-box on each half, rotate left by 3 | expand R from 32 to 48 bits, ⊕ K, eight 6→4 S-boxes, permutation P |
| Extra | none | initial permutation IP before, IP−1 after |
The key 3A94 gives the round keys 3A, A9, 94, 43, and the plaintext 4869 ("Hi" in ASCII) goes through the rows 4869 → 6910 → 101D → 1DE1 → AAE1. The S-box is the one from the PRESENT cipher, C 5 6 B 9 0 A D 3 E F 8 4 7 1 2: the only part that is not linear. Without it, every output bit would be an XOR of input and key bits, and a few known pairs would give the key by solving equations.
How many rounds
One round is not enough: the right half goes through untouched, so 4869 encrypts to 1069 and the "69" can be read straight off the ciphertext (Demo: one round is not enough). After two rounds every half has been changed once, but simple relations between input and output still hold. More rounds spread every input bit over the whole block. Flip the last bit of 4869 to get 4868, and the number of bits that differ between the two runs grows row by row: 1, 4, 9, 11, then 8 of 16 at the output, about half. That is the avalanche effect (Demo: avalanche, flip one plaintext bit). Over many plaintexts, one flipped bit changes 8.0 of the 16 output bits on average. DES uses 16 rounds because attacks such as differential cryptanalysis still work against DES cut down to fewer rounds.
Real DES
The 56-bit key is split into two 28-bit halves. Each round rotates both halves left by one or two places (16 rotations add up to 28, so the halves end where they started) and picks 48 of the 56 bits as that round's key. In F, the expansion E copies some of R's 32 bits twice to get 48 bits, the round key is XORed in, and each of the eight S-boxes turns 6 bits into 4. The permutation P then moves the 32 bits so that each S-box feeds several S-boxes in the next round. A worked example used in many textbooks: key 133457799BBCDFF1 encrypts the block 0123456789ABCDEF to 85E813540F0AB405.
Why 56-bit keys fell
The best practical attack on DES was never clever: it was trying every key. With one known plaintext and its ciphertext, the attacker encrypts the plaintext under each key and keeps the keys that give the right ciphertext. The toy key has only 65 536 values, and exactly one of them, 3A94, turns 4869 into AAE1. A second pair, 4F4B → 593D, confirms it (Demo: brute-force the 16-bit key).
DES has 256 ≈ 7.2 × 1016 keys. In 1998 the EFF built Deep Crack, a machine of custom chips that tried about 90 billion keys a second: the whole key space in about 9 days. It found a DES key in 56 hours, and with volunteers' computers (distributed.net) another one in under a day in 1999. NIST withdrew single DES in 2005.
3DES: three times DES
The quick fix was to run DES three times: C = E_K3(D_K2(E_K1(P))), encrypt–decrypt–encrypt (EDE) (Demo: triple encryption (EDE)). The middle step is a decryption so that with K1 = K2 = K3 the first two steps cancel and 3DES is exactly single DES: old and new devices could talk to each other. Why not just two keys in a row? Double encryption falls to a meet-in-the-middle attack: encrypt the plaintext under every K1, decrypt the ciphertext under every K2, and look for a value in the middle that matches. That costs about 257 steps, not 2112. The same trick cuts three-key 3DES (168 key bits) to about 112 bits of strength.
3DES is slow (48 rounds for each block) and still has a 64-bit block. After about 232 blocks, around 32 GB, under one key, equal ciphertext blocks start to appear and leak plaintext (the Sweet32 attack, 2016). NIST disallowed 3DES for encryption after 2023. Its replacement, AES, is not a Feistel network; see Inside AES-128 and SHA-256 for its rounds and Block Cipher Modes for how any block cipher, DES included, is used on messages longer than one block.
See also Symmetric vs Asymmetric Encryption for how two sides agree on a shared key in the first place.
What the page leaves out
The real DES tables (IP, E, the eight S-boxes, P, PC-1, PC-2), which the page states but does not draw; the design rules behind the DES S-boxes and their resistance to differential and linear cryptanalysis; DES's weak and semi-weak keys and the complementation property; DESX and other key-whitening fixes; two-key 3DES and its lower strength; other Feistel ciphers such as Blowfish, Twofish and Camellia; and real key sizes for the toy, whose 16-bit key and block make it useless for anything but learning.