## How does the Polybius cipher work?

The Polybius square cipher first distributes the letters of a chosen alphabet into a grid (typically 5×5). Here’s the original square used by the Greeks who invented the cipher.

For the Latin alphabet to fit into a 5×5 square, two letters must be combined (usually `I` and `J` or `C` and `K`). For this, we first replace one letter by the other before encrypting. This is why the letter `J` is not present in the following square.

To encode a message, each letter is translated to its coordinates in the grid – typically first row, then column. For instance, the letter `X` is at row 5 and column 3. Thus, the plaintext letter `X` translates to the ciphertext `53`.

For the typical Latin alphabet square above we get the following map:

## What makes the Polybius cipher special?

By applying a Polybius cipher encryption you shrink the set of symbols necessary to represent a message from the original alphabet (typically 26 symbols) to the set of symbols you need to denote the coordinates of each letter in the ciphertext (typically 5 symbols). This can be very useful for telegraphy, steganography, and cryptography.