CYRUNE

Playfair cipher

The Playfair cipher encrypts letters two at a time using a 5 × 5 square built from a keyword. Working in pairs hides single-letter patterns, which made it much stronger than the substitution ciphers before it.

Difficulty in Cyrune: ★★★★★

A little history

Charles Wheatstone invented the cipher in 1854, but it's named after his friend Lord Lyon Playfair, who promoted it to the British government. The British army used it in the Boer War and the First World War, because it was quick to use in the field with nothing but a pencil. In 1943, a coastwatcher's Playfair message helped rescue the crew of PT-109, the patrol boat commanded by the future US president John F. Kennedy.

How it works

First build the square: write the keyword's letters (dropping repeats), then the rest of the alphabet, with I and J sharing a cell. Here is the square for the keyword CRANE:

12345
1CRANE
2BDFGH
3I/JKLMO
4PQSTU
5VWXYZ

Then split the message into pairs (adding an X to finish an odd one) and encrypt each pair with three rules:

  1. Same row: take the letter to the right of each (wrapping round).
  2. Same column: take the letter below each (wrapping round).
  3. Otherwise: the two letters mark the corners of a rectangle; take the other two corners, staying in each letter's own row.
Worked example: keyword CRANE
MessageWATER
PairsWA TE RX
CipherXR UN AW

Decrypting reverses the rules: left instead of right, up instead of down; the rectangle rule is its own reverse.

How to crack it

Playfair hides single-letter frequencies, but pairs still have them: TH, HE and ER are common in English, and their encrypted forms show up as common pairs in the ciphertext. A pair and its reverse (AB and BA) encrypt to reversed pairs, and a letter never encrypts to itself. With a long enough message, a codebreaker can rebuild the square piece by piece.

Playfair in Cyrune

The five-letter word gets an X on the end to make three pairs, so there are six lamps, and the sixth must decode to the padding X. Pin letters you know (green tiles pin themselves), then Test keywords: it tries every common five-letter word as the keyword and lists the ones that fit.

Related ciphers