Skip to main content


Home Playfair cipher

Playfair cipher

Playfair cipher definition

The Playfair cipher is a manual symmetric encryption method once used to secure sensitive military communications. It encrypts letters in pairs (digraphs), unlike traditional ciphers that encrypt one letter at a time.

See also: substitution cipher, Caesar encryption, cryptographic key, cryptographic algorithm, decryption

How the Playfair cipher works

  1. 1.The Playfair cipher uses a 5x5 grid, where each square contains an alphabet letter (combining “I” and “J” to fit into the 25 spaces).
  2. 2.To encrypt a message, the sender and receiver agree on a keyword. This keyword is written in the grid first, filling the rest with the remaining alphabet letters in order.
  3. 3.During encryption, pairs of letters are substituted based on simple rules depending on their positions (e.g., if they're in the same row or column).
  4. 4.The encrypted pairs of letters are combined to form the ciphertext.
  5. 5.The receiver of the encrypted message reads it by reversing the encryption process.

History of the Playfair cipher

  • 1854: The Playfair cipher was invented by Charles Wheatstone, a British scientist. The cipher's name comes from Lord Lyon Playfair, a prominent scientist and politician. Playfair was a friend of Wheatstone and helped popularize the cipher.
  • Late 19th century: British forces first used the cipher operationally during the Boer War.
  • World War I: The Playfair cipher's most extensive use was during World War I. British forces adopted it for secure, quick field communications with no special equipment.
  • Post-WWI: As better encryption methods and machines came along, the Playfair cipher fell out of use for serious military purposes.

Uses of the LMHOSTS file

  • Military communications. The primary use of the Playfair cipher was in military settings. It helped encrypt tactical messages that needed to remain secret from enemy forces.
  • Educational tool. Today, it is often used for teaching about codes and secret messages in a simple way.
  • Recreational cryptography. People also use it for fun in puzzles and code-breaking challenges.