HomeCiphers › Playfair

Playfair

Letters travel in pairs, so counting single letters tells a code-breaker almost nothing. It lasted into two world wars.

Rail Fence

Press Run it to start the machine.
0 / 0
Result

How it works

Build a five by five square from a key word, then split the message into pairs. Each pair is looked up in the square and replaced by two other letters, following one of three rules. Because it works on pairs, counting single letters tells a code-breaker almost nothing.

  1. Write the key word into the square, then the rest of the alphabet. I and J share a cell.
  2. Split the message into pairs, pushing an X between any double letter.
  3. Same row: take the letter to the right of each. Same column: the letter below each. Otherwise: swap to the other corner of the rectangle, staying in your own row.

The story

London, 1854

The cipher named after the wrong man

Charles Wheatstone invented it. His friend Lyon Playfair took it to the Foreign Office, who turned it down as too complicated. Wheatstone offered to teach it to three out of four boys from a nearby school in fifteen minutes. The name that stuck was Playfair’s, not Wheatstone’s. The British Army used it in the Boer War and both world wars, because two people with a key word and no equipment could send messages a field telephone could not protect.

Crack these

What do you call a fish with two knees?
Why did the scarecrow get a prize?
← Lewis Carroll's Table All the ciphers Atbash →

Take it off the screen

Print this page and you get a worksheet: how the cipher works, where it came from, and the puzzles to crack, with the machine and the menus left off.

Print this page as a worksheet Try the challenges

Read more elsewhere

Longer, harder and written for grown-ups. Worth a look when this page runs out.

Playfair cipher