Four-Square Cipher
Encrypts text two letters at a time using two keyword grids, with I and J sharing one cell and a trailing X padding an odd length. Encoding only.
Cifrado
—
Four-square: four grids to encipher in pairs
The four-square cipher, also from Delastelle, enciphers two letters at a time using four five-by-five grids. Two of them hold the alphabet in order and serve to locate the plaintext letters; the other two are scrambled by keywords and are where the ciphertext comes from. Enciphering in pairs is what sets it apart from letter-by-letter substitutions.
Enter the text and the two keys. Each pair of letters is located in the reference grids, and the result comes from the ciphering grids at the intersection of the matching rows and columns. As with the Polybius square, I and J share a cell, and an X is appended when the text has odd length, to close the final pair.
Enciphering in pairs is the real gain: frequency analysis of single letters stops working, because what matters is digram frequency — and that is far more spread out. Compared with Playfair, which uses two grids and has special rules for repeated letters and for pairs sharing a row, four-square is simpler to apply, since every pair falls into the general case.
Frequently asked questions
Do I need two different keys?
Why does an X appear at the end?
Is it stronger than Playfair?
Related Tools
Polybius Square Cipher
Encrypt and decrypt messages with the Polybius square, which turns each letter into a pair of digits on a 5×5 grid (with I and J combined).
Playfair Cipher Step by Step
Encrypt/decrypt with Playfair showing the 5×5 matrix, letter pairs and the rule applied to each digram.
Frequency Analysis to Break Ciphers
Count letter, bigram and trigram frequencies in ciphertext and compare with Portuguese/English references.
Vigenère Autokey Cipher Encoder and Decoder
Enciphers or deciphers text with the classic autokey variant, where the plaintext extends the keyword instead of repeating it. Letters A to Z only.
Nihilist Cipher Encoder
Encodes text with the Nihilist cipher: every letter becomes its Polybius square coordinate, with I and J sharing a cell, added to a repeating numeric key.
Bifid Cipher with Custom Key
Encrypts text with the Bifid cipher using a 5x5 Polybius square built from your keyword, merging I and J and interleaving row and column coordinates.