Encrypt or decrypt messages using the Playfair cipher with a custom key.
Enter a key and text, then click Encrypt or Decrypt.
The Playfair cipher is a digraph substitution cipher invented by Charles Wheatstone in 1854 and promoted by Lord Playfair. It encrypts pairs of letters (digraphs) rather than single letters, making it more secure than simple substitution ciphers. The encryption uses a 5×5 matrix built from a keyword, with the letters A-Z (excluding J). Each pair of letters is encrypted using three rules: if in same row, shift right; if in same column, shift down; otherwise, form a rectangle and swap corners. This calculator provides both encryption and decryption, handling text preparation automatically (removing spaces, replacing J with I, inserting X between double letters). The Playfair cipher is an excellent introduction to classical cryptography and is still used in some educational contexts.
- Enter a Key (keyword or phrase) for the cipher.
- Enter the Text you want to encrypt or decrypt.
- Click Encrypt to encode the message.
- Click Decrypt to decode the message (requires the same key).
- The result shows the processed text with the original for reference.
- Click Reset to restore default example values.