Playfair cipher
The Playfair cipher encrypts letters two at a time using a 5×5 square built from a keyword, with I and J sharing a cell. The output is a block of letters: spaces and punctuation are dropped, doubled letters are split with an X, and an odd-length message is padded.
About the Playfair cipher
Charles Wheatstone invented the cipher in 1854; it carries the name of Lord Playfair, who championed it to the British government. Encrypting digraphs instead of single letters was its innovation: with 600-odd digraph frequencies to tabulate instead of 26 letter frequencies, simple frequency analysis becomes much harder, yet the whole system fits on a 5×5 grid two soldiers can share as a single memorable word. It served British forces in the Boer War and the First World War, and Australian coastwatchers in the Second.
Its rules are mechanical. Letters in the same row of the square move one step right, letters in the same column move one step down, and any other pair forms a rectangle whose corners swap columns. Decryption reverses the shifts. The structure leaks, though: a digraph and its reverse encrypt to a pair and its reverse, and X-split doubles betray themselves. With a few hundred letters, Playfair falls to hill-climbing over candidate squares — a solver is on this site's roadmap.