# Playfair: the three digraph rules on a LANTERN square
The Playfair cipher encrypts pairs of letters using a 5 by 5 square built from a keyword. I and J share a cell, so the square holds 25 letters. Three rules decide what each pair becomes, and a short example shows all of them.
Contents
# Build the square
Use the keyword LANTERN. Remove the repeated N, then add the remaining letters in order, treating I and J as one:
- L A N T E
- R B C D F
- G H I K M
- O P Q S U
- V W X Y Z
# A worked example
Encrypt the pairs HE, LO, BU, NT, ER:
- Rectangle rule. HE sits at row 3, column 2 and row 1, column 5. The letters are on different rows and columns, so each is replaced by the letter in its own row and the other letter’s column: H becomes M and E becomes A, giving MA. BU works the same way and gives FP, and ER gives LF.
- Same column. L and O are both in column 1. Move each one down a row, wrapping at the bottom: L becomes R and O becomes V, giving RV.
- Same row. N and T are in the top row. Move each one right, wrapping at the end: N becomes T and T becomes E, giving TE.
To decrypt, reverse the movements: left instead of right, up instead of down, and the rectangle rule unchanged.
The full procedure, including how to split plaintext into pairs, is explained on the Playfair cipher page.
# Common mistakes
- Moving the wrong way. Encryption goes right and down; decryption goes left and up.
- Wrapping incorrectly. A letter at the end of a row wraps to the start of the same row, not the next one.
- Reading the rectangle by rows instead of corners. Each letter takes the column of its partner, staying in its own row.
- Forgetting the I/J merge. Decide in advance how J is written and how the result is read back.
Published by the caesarcipher.org team; drafted with AI assistance.
End