Skip to main content

Playfair Cipher Explained: The Encryption British Soldiers Used in the Field

How encrypting letters in pairs beat frequency analysis, using nothing but pen and paper

Updated 5 min readMarkdown
Part of seriesCryptography & Security
Playfair Cipher Explained: The Encryption British Soldiers Used in the Field

An officer in the field needs to send a message that can't be read if intercepted. No radio, no computer, just pen, paper, and a shared keyword with whoever's receiving it. Simple substitution ciphers like Caesar's fall apart under basic frequency analysis. The Vigenère cipher fixes that, but it needs a long, carefully managed key to stay secure, something that's genuinely hard to manage under battlefield conditions.

You need something fast enough to use by hand, with nothing but a keyword, that's still meaningfully harder to crack than swapping one letter for another.

That's the problem the Playfair cipher was built to solve.

What Makes It Different

Every cipher you've seen so far in this series encrypts one letter at a time. Playfair encrypts pairs of letters, called digraphs, together. That single change matters more than it sounds like it should.

When you encrypt one letter at a time, the letter E always becomes the same ciphertext letter, and that pattern survives encryption, which is exactly what frequency analysis exploits. When you encrypt letters in pairs instead, the same letter can end up as part of a different pair each time, depending on what sits next to it. That breaks the simple frequency pattern that makes single-letter ciphers so fragile.

Why the Military Actually Used This

Playfair wasn't a theoretical exercise. It saw real combat use. British forces used it during the Second Boer War and World War I, and Australian forces used it during World War II. It stayed in military use because of one practical reason: it requires no special equipment. An officer with a keyword and a pencil could encrypt and decrypt messages by hand, fast enough to be usable in the field, while still being meaningfully harder to break than a plain substitution cipher.

Building the Key Grid

Everything starts with a 5x5 grid built from a keyword. Say the keyword is MONARCHY. Write out its unique letters first, then fill the rest of the grid with the remaining letters of the alphabet in order. Since a 5x5 grid only holds 25 cells and the alphabet has 26 letters, I and J share a single cell.

M O N A R C H Y B D E F G I/J K L P Q S T U V W X Z

Both sender and receiver build this same grid from the same keyword, that's the whole key.

Splitting the Message Into Pairs

Take a real field order: MOVEOUTATDAWN, 13 letters. Split it into pairs:

MO VE OU TA TD AW N_

Thirteen letters don't split evenly, so the final N gets padded with a filler, Z in this case, giving you NZ as the last pair.

Encrypting Each Pair

Rule 1: Same row. Replace each letter with the one immediately to its right, wrapping around if needed.

Take MO. M sits at row 0, column 0. O sits at row 0, column 1, same row. Shift each one right: M becomes O, and O becomes N.

MO → ON

Gemini_Generated_Image_pmamcwpmamcwpmam

Rule 2: Same column. Replace each letter with the one directly below it, wrapping around if needed.

Take TD. T sits at row 3, column 4. D sits at row 1, column 4, same column. Shift each one down: T wraps around to Z, and D becomes K.

TD → ZK

Gemini_Generated_Image_603a4h603a4h603a

Rule 3: Different row and column. The two letters form a rectangle. Replace each letter with the one in its own row, but in the column of the other letter.

Take VE. V sits at row 4, column 1. E sits at row 2, column 0, a different row and column. V gets replaced with the letter in row 4, column 0, which is U. E gets replaced with the letter in row 2, column 1, which is F.

VE → UF

Gemini_Generated_Image_4ubsvx4ubsvx4ubs

The remaining pairs, OU, TA, AW, and NZ, all follow this same rectangle rule:

Pair Positions Rule Result
OU O(0,1), U(4,0) Rectangle MV
TA T(3,4), A(0,3) Rectangle SR
AW A(0,3), W(4,2) Rectangle NX
NZ N(0,2), Z(4,4) Rectangle RW

Putting every pair together:

MOVEOUTATDAWN → ONUFMVSRZKNXRW

Where It Breaks Down

Playfair hides single-letter frequency patterns well, but it doesn't hide everything. Digraph frequencies aren't flat either; some letter pairs (like TH or ER) show up far more often in English than others, and enough intercepted ciphertext eventually leaks that pattern too. Cryptanalysts in the early 20th century learned to exploit exactly this, and Playfair fell out of serious use once more rigorous techniques (and eventually computers) made it breakable within a reasonable amount of effort.

The grid itself also limits it. Only one 26th letter can exist in a 25-cell grid, forcing I and J together, which occasionally creates ambiguity a computer wouldn't tolerate but a human reader can usually resolve from context.

When to Actually Reach for This

Not for real security today; computers make even digraph-frequency analysis trivial. But it earns its place for a few reasons:

  • Understanding the shift from single-letter to multi-letter encryption. This is the conceptual ancestor of modern block ciphers, which encrypt fixed-size chunks of data together rather than one symbol at a time.

  • A genuinely usable historical field cipher, worth knowing precisely because it was designed around a real practical constraint: speed and no equipment, not just theoretical strength.

  • A clean teaching tool for grid-based cryptography, before moving into anything involving actual computation.

Playfair didn't win by being unbreakable. It won by being fast enough to actually use when it mattered, and strong enough to be worth the trouble of breaking.

About the author

  • Mobile app developer with more than half a decade building production apps. Interested in software engineering, computer science, and how theoretical concepts apply to real systems, from algorithms and cryptography to AI and distributed systems. Also sharing notes from books and podcasts along the way.

No comments yet. Be the first to comment.

Cryptography & Security

Part 3 of 3

Classical and modern cryptography, network security, digital forensics, and security auditing, concepts explained through the real-world problems they solve.

Start from the beginningCaesar Cipher Explained: A 2,000-Year-Old Encryption TrickThe simple shift cipher behind ROT13, and why it's trivially broken today