0

Decoded

Playfair
Key (A-Z)

Encoded

Playfair
Key (A-Z)

About the Playfair Cipher

The Playfair Cipher is a substitution cipher that replaces pairs of letters using a 5×5 letter table.

For example, when the key is "SECRET" and the plaintext is "HELLO", it is encrypted as follows.

Plaintext  : HELLO
Ciphertext : ISKYIQ

First, the plaintext is split into pairs of letters. If a pair contains the same letter, such as "LL", an auxiliary letter "X" is inserted between them. If one letter remains at the end, an auxiliary "X" is also added.

HE LX LO

Next, prepare a 5×5 (25-cell) cipher table. The table has room for 25 letters, but the alphabet has 26 letters, so "I=J" is usually placed in the same cell.

First, write the letters of the key into the table without duplicates. With the key "SECRET", the second "E" is skipped. Then write "ABCDEFGHIKLMNOPQRSTUVWXYZ", again skipping letters that already appear in the key. This creates a 5×5 cipher table with no duplicate letters.

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

Using this table, encrypt each pair of letters according to the rules below. The method depends on how the two letters are positioned in the table.

S E
A B
H I

K L
P Q
X Y

I K L
O P Q
HE LX LO
↓
IS KY IQ

For decryption, process the ciphertext in pairs using the same letter table. Note that the auxiliary letter "X" is not removed automatically.

Ciphertext : ISKYIQ
Plaintext  : HELXLO