Playfair Cipher

A digraph substitution cipher that encrypts pairs of letters using a 5×5 matrix constructed from a keyword. It was the first practical digraph substitution cipher.

How it works:

  • Creates a 5×5 matrix from the keyword (I and J share a cell)
  • Text is divided into pairs (digraphs) and encrypted together
  • If both letters are in the same row/column, shift is applied
  • Otherwise, they form a rectangle and are swapped accordingly