Cabinet Noir>History / Rail fence

Not sure which cipher? Identify it
learning.railFence.description
Typetransposition cipher
Breaking ittrivial to break
EraAmerican Civil War
NameFence-line ciphers; the scytale as the ancient forerunner
Modesencrypt · decrypt · cryptoanalysis

History

Rail fence

History of the Rail fence cipher

The scytale: the fence's ancient ancestor

The oldest transposition on record is Sparta's scytale: a strip of leather wound helically around a staff of the right thickness, written across, and read as nonsense once unwound. Wind it back on a staff of the same diameter and the message returns. It is not the rail fence — the wrap is a spiral, not a zigzag — but the principle is identical: the shape of the carrier is the key, and the letters never change. Around 400 BC the Greek writers already knew both the cipher and its downfall: the staff's diameter is a small, guessable secret.

The American Civil War: rails in the field

By the nineteenth century the zigzag had its name and its folklore. Rail fence — so called because the ciphertext looks like rails of a fence laid side by side — was pencil-and-paper soldier's work on both sides of the American Civil War: quick to write, quick to read, and quick to break by anyone who guessed the fence's shape. Union route ciphers, more elaborate cousins of the zigzag, carried Federal messages in Confederate territory; their safety lay more in speed and disguise than in mathematics.

The schoolbook afterlife

Once serious cryptography moved to keyed alphabets and then machines, the rail fence settled into a long afterlife in puzzle books, scout manuals and classrooms. It keeps exactly one lesson worth teaching: a transposition changes only where the letters are, so the letters themselves stay in plain view — and a small enough key space is no key at all. Every modern course still opens transposition with the zigzag, for the same reason this app does.

{{timeline:railFence}}