Playfair Cipher
Encrypt pairs of letters using a 5×5 key square built from a keyword.
Difficulty: Intermediate
How it works
- Choose a keyword such as MONARCHY and build a 5×5 key square. Write the keyword, skipping repeated letters, then fill in the remaining letters of the alphabet (often merging I and J).
- Prepare your plaintext by turning it into digraphs (pairs of letters). Insert an X between identical letters in a pair and add an extra X at the end if needed to keep pairs complete.
- For each pair, locate the two letters in the key square and apply the Playfair rules: same row, same column or forming the corners of a rectangle.
- In the same row, you shift each letter one step to the right (wrapping around). In the same column, you shift each letter one step down. In a rectangle, you take the letters at the other two corners of the rectangle in the same row.
- To decrypt, you reverse these movements: shift left for same-row pairs, up for same-column pairs, and again use the opposite rectangle corners.
Press Shift + Enter
What is it?
The Playfair Cipher was the first practical digraph substitution cipher. The scheme was invented in 1854 by Charles Wheatstone, but bears the name of Lord Playfair who promoted its use. It encrypts pairs of letters (digraphs) instead of single letters, using a 5x5 grid containing the letters of the alphabet (usually combining I and J). Because it operates on 600 possible digraphs rather than 26 single letters, it is significantly harder to break using frequency analysis than simple substitution ciphers.
Try it yourself
Can you decrypt this challenge?
VHVY GUVF ZRNGL (example ciphertext)
Where this shows up today
To create a field cipher that was quick to use but resistant to standard frequency analysis.