Series E · The Toy That Ties It Together

The Cipher & The Shadow

XOR Stream Cipher · Encrypt ⟷ Decrypt · And The Leak You Can See

A real (toy) cipher you can run both ways. Type a message, a key makes a keystream, and XOR turns text into noise. The same key XORs it back — that's the whole trick. A wrong key gives garbage. And below it: the power trace — the morse-in-the-substrate — leaking the rhythm of the computation even though the ciphertext looks random. Flip the defense to watch the leak flatten.

constant-power defense
① ciphertext (looks like noise)
② decrypt with the SAME key → recovers plaintext
③ the power trace · the leak (bits switched per byte = the morse)

§ How It Works

Encrypt: the key seeds a keystream (a sequence of pseudo-random bytes). Each plaintext byte is XOR'd with a keystream byte → ciphertext. XOR scrambles it into something that looks random.

Decrypt: XOR the ciphertext with the same keystream → the original returns. XOR is its own inverse: (p ⊕ k) ⊕ k = p. Same key both ways. Wrong key → garbage: without the exact keystream, there's nothing to recover — ciphertext is indistinguishable from noise.

encrypt: c = p ⊕ k  ·  decrypt: p = c ⊕ k  ·  the key is everything; the math is reversible only with it.

§ The Shadow

The ciphertext looks like noise — but the power trace (bars ③) doesn't. Each bar is how many bits switched that cycle: the chip's current draw, the morse in the substrate. The rhythm leaks the computation even though the values are hidden — exactly the side-channel that breaks real hardware. Toggle constant-power defense: every bar flattens to the same height, the rhythm carries no information, and the leak closes — at the cost of doing fake work to mask the real.

XOR STREAM CIPHER · c = p ⊕ k · SAME KEY DECRYPTS · WRONG KEY = NOISE
THE CIPHERTEXT HIDES THE VALUES · THE POWER TRACE LEAKS THE RHYTHM (THE MORSE)
CONSTANT-POWER DEFENSE FLATTENS THE SHADOW · THE LEAK IS PHYSICS, CLOSED BY PHYSICS
THE CIPHER & THE SHADOW · SERIES E · JUNE 2026