◄ WORLD V · SONNY 5DART 192 · a helldive at the net

SUBSTITUTION-
PERMUTATION NETWORK substitute for confusion, permute for diffusion, repeat

The other great cipher skeleton (AES is one): each round XORs a key, runs every chunk through an S-box (substitute — confusion), then permutes the bits across the whole block (diffusion), and repeats. Substitution hides the key relationship; permutation spreads each input bit over the entire block so a few rounds reach full avalanche. Unlike Feistel it transforms the whole block each round, so it needs inverse S-boxes to decrypt.

THE TECHNIQUE XOR key -> S-box -> bit permute, per round

One SPN round: XOR the key, substitute through the S-box, rotate the bits. Decryption runs the inverses in reverse. Watch a block cipher one round and come back — substitute + permute + key, exactly invertible: live demo


HISTORY & CREDIT Shannon 1949; Feistel/AES

“SPN and Feistel are rival designs; one is better.” — no, they are two ways to reach the same goal. Feistel (190) gets free decryption but mixes half a block per round; an SPN mixes the whole block per round (faster diffusion) but must invert every layer. AES chose SPN, DES chose Feistel — a trade, not a winner. cited

1949 · Claude Shannon — proposes alternating confusion (substitution) and diffusion (permutation) as the recipe for a strong cipher.
1971 · Feistel’s Lucifer — an early substitution-permutation design realising Shannon’s idea.
2001 · AES / Rijndael (Daemen & Rijmen) — the canonical modern SPN: SubBytes, ShiftRows, MixColumns, AddRoundKey.

Diffusion is the permutation’s job: after the S-box scrambles a chunk, the bit-permutation carries those changed bits into other chunks, so the next round’s S-boxes scramble across the whole block — that spreading is what makes avalanche (194) reach half in a few rounds. Shannon 1949

RECOMMEND FOR I-13 whole-block round, invertible, computed

On the canonical compiler one SPN round round-trips with inverse S-box and inverse rotate — all bitwise:

$ i13 run spn.i13 # round = rotl( Sbox( b xor key ), 3 ); inverse = Sinv( rotr(., 3) ) xor key pt = 202 ct = 109 -- XOR key, substitute both nibbles, rotate bits back = 202 -- inverse rotate, inverse S-box, XOR key -> exact
Recommend: the substitution-permutation network is LIT and the other cipher skeleton for I-13 — verified one round rotl(S(b ⊕ key), 3) encrypts 202 → 109 and inverts back to 202 with the inverse S-box and inverse rotate, all in /<</>>/array. It pairs the S-box (191, confusion) with a bit-permutation (diffusion) so avalanche builds fast; it transforms the whole block each round (unlike Feistel 190), at the cost of needing inverse layers. It is the AES shape — the strongest, most-analysed symmetric structure — reduced to what I-13 already has.