handy.moe

All tools / Hacker kit

A winners podium

Playfair cipher

Playfair encrypts pairs of letters with a 5×5 square built from a key phrase. Type the phrase to see the square, then encrypt or decrypt.

Runs in your browser. Nothing you type is sent anywhere.

How to use it

  1. Type a key phrase. The square appears below.
  2. Type your message and choose Encrypt. Pairs of the same letter are split with X, and J counts as I.
  3. To decrypt, paste the letter pairs and choose Decrypt.

The rules

Two letters in the same row become the letters to their right; in the same column, the letters below; otherwise each takes the corner of its rectangle in its own row. Charles Wheatstone invented it in 1854 and Lord Playfair promoted it. It was used in the Boer War and the First World War. It's tested against the classic worked example with the key “playfair example”.

Questions

Why is there an X in my message?

Playfair can't encrypt a pair of the same letter, so an X is put between them (and at the end if the length is odd). Remove those when you read it.

Where did J go?

The square has 25 letters, so J shares a cell with I.