By Debmedia Technologies LLP · Kolkata, India · Updated
What Is It and When Do You Need It?
The Playfair cipher was the first practical cipher to encrypt pairs of letters. It was used in the Boer War and in both world wars. Pairs hide letter frequencies better than single-letter ciphers do.
Enter text and a keyword to see the square and the result.
How to Use This Tool
- Type your text.
- Enter a keyword.
- Choose encrypt or decrypt.
- Press Run and read the square and the pairs.
How the Calculation Works
The square is made from the unique keyword letters followed by the rest of the alphabet (J is merged into I). The plain text is cleaned to letters only and split into pairs, inserting X between a double letter and at the end if needed. Each pair is moved by the row, column or rectangle rule. Decryption reverses the moves.
Worked Example
With the keyword PLAYFAIR EXAMPLE, HIDE THE GOLD IN THE TREE STUMP becomes BMODZBXDNABEKUDMUIXMMOUVIF.
Common Uses
- Puzzles and escape rooms.
- Teaching digraph ciphers.
- History of cryptography.
- Capture-the-flag challenges.
Tips and Common Mistakes
- Decrypted text may contain the filler X letters.
- Remove spaces and punctuation before comparing.
- A longer keyword mixes the square better.
Related Tools
Next, you may need the Vigenère cipher, Polybius square, affine cipher, rail fence cipher.
Everything runs in your browser. Nothing you type is uploaded, stored or sent to any outside service.
Frequently Asked Questions
Disclaimer: results are calculated in your browser from the numbers you enter. Check important results before you rely on them for money, health, safety or legal decisions.