Crypto Corner
  • Home
    • Crypto Corner Challenges
    • Glossary
    • Help with Activities
    • Educational Uses
    • Downloadable Resources
  • Introduction to Cryptography
    • Steganography
    • Codes and Ciphers
    • Conventions in Cryptography
  • Monoalphabetic Substitution Ciphers
    • Atbash Cipher
    • Pigpen Cipher
    • Caesar Shift Cipher
    • Affine Cipher
    • Mixed Alphabet Cipher
    • Other Examples
    • Frequency Analysis: Breaking the Code
    • Homophonic Substitution
  • Simple Transposition Ciphers
    • Rail Fence Cipher
    • Route Cipher
    • Columnar Transposition Cipher
    • Myszkowski Transposition Cipher
    • Permutation Cipher
    • Anagramming: Jumbling words
    • Combining Monoalphabetic and Simple Transposition Ciphers
  • Polyalphabetic Substitution Ciphers
    • Vigenère Cipher
    • Kasiski Analysis: Breaking the Code
    • Autokey Cipher
    • Other Examples
  • Fractionating Ciphers
    • Polybius Square
    • Straddling Checkerboard
    • Transposing Fractionated Text
    • Other ways to Alter Fractionated Text
  • Digraph Substitution Ciphers
    • Playfair Cipher
    • Two-Square Cipher
    • Four-Square Cipher
    • Hill Cipher

Polybius Square

  1. Cipher Activity
  2. Introduction
  3. Encryption
  4. Decryption
  5. Discussion
  6. Exercise

Alphabet:



Plaintext:

Ciphertext:

Options:


The Polybius Square is an ancient Greek invention, discovered by a scholar named Polybius. For the Greek alphabet of 24 letters, it consisted of a 5 by 5 grid where each square of the grid was filled by a single letter. In the English Alphabet of 26 letters, we have one too many letters. To get round this we combine two letters, traditionally "i" and "j". It is also possible to combine other pairs, such as "v" and "u". Another alternative to the Polybius Square for english is to include the digits 0-9, so we have 36 characters.
Picture
The standard Polybius Square for English
Picture
The extended Polybius Square for English including the digits 0-9
With the Square, we replace each letter with the two numbers that represent its position in the grid. We can choose whether we go across then down, or vice versa, as long as we keep it the same the whole way through. We shall go across first, so "h" is "32" in the standard table.
This encyrption is standard, and so far has no key, and thus is easily broken. We need to introduce the idea of a key to the Polybius Square to make it more secure (Kerckhoffs's Principle). This is done in a very simple way. We reorder the alphabet in the same way as we did for the Mixed Alphabet Cipher before we put it in the grid. That is, we use the letters of the keyword first, ignoring any repeat So using a keyword of polybius we get the mixed square below.
Picture
The Mixed Square generated using the keyword polybius
Encryption
The encryption process using a Polybius Square is fairly straightforward. First we have to generate the Mixed Square, using a keyword as above (or another rule such as reversing the alphabet, or shifting the alphabet). Once the Mixed Square is generated, we replace each letter with the "coordinates" of the letter within the grid, reading across first and then down.
As an example, we shall encrypt the plaintext "nice and simple" with the keyword example.
First we make the Mixed Square using the keyword. We start by filling in the squares in the grid with the letters of the keyword, ignoring repetitions, and then continue with the rest of the alphabet.
Picture
The Mixed Square using keyword example
With the Square complete, we simply find each plaintext letter in the grid, and replace it with its coordinates. So "n" becomes "53", "i" becomes "33", "c" becomes "32" and so on. Continuing like this we get the ciphertext "53333211 315342 443341511211".
Decryption
Decrytion is really easy too. We again make up the Mixed Square using the keyword, and then use the pairs of numbers to locate the plaintext letter in the grid, remembering the
We shall decrypt the message "42342115532354 23423241 23454224113123" using the keyword polybius.
First we must generate the Mixed Square in exactly the same way as we did before.
Picture
The Mixed Square using keyword polybius
Now we look at pairs of letters in turn. So "42" represents "a", "34" is the plaintext letter "n" and "21" is "o". Continuing in this way we get the plaintext message "another easy example".
Discussion
The Polybius Square was not originally intended as a cipher in its own right, but rather an aid to telegraphy. By using five different coloured flags (one to represent each of the digits 1-5) you could signal a message across a long distance easily, by holding two flags at a time. In this way, it is much like Morse Code, but much simpler to learn.
It has also been used as a "knock code" throughout history for prisoners to send messages to each other by knocking on the wall. It was used successfullly in this way by American prisoners of war in the Vietnam War, to talk to each other without detection.
As a cipher it is not particularly secure, even when using a keyword, since it is essentially a Monoalphabetic Substitution Cipher. That is, each plaintext letter is represented by the same pair of digits everytime, and thus an intercept is susceptible to Frequency Analysis. The analysis has to be done on pairs of numbers, but this is trivial to even an amateur cryptanalysist.
However, since each letter is represented by a digraph, the Polybius Square is a fractionating cipher, and as such can be used in conjunction with a transposition cipher to great effect. We shall see how this works later.
There are several ways we may choose to adapt the square itself. The first is the choice to combine "I" with "J" to make the letters fit. We could combine any other pair of letters in the same way. Care needs to be taken when decrypting the message to make sure we use the right letter, but this is obvious from the context of the rest of the word.
The second is that we could choose to read the "coordinates" down first and then across. This would reverse each pair on digits in the ciphertext, but works perfectly well, as long as sender and receiver do the same thing. You could make it a bit more complex by switching between the two methods after every letter, introducing a touch of a Polyalphabetic Cipher, and making frequency analysis more difficult.
The final way to adapt the Square is to use a different alphabet. Including the digits 0-9 gives an alphabet of length 36, so a 6 by 6 grid works perfectly (without combining any letters). You might also want to include some punctuation, and you would have to create a grid to fit the size of your alphabet. This could mean making a rectangular grid, or combining letters.
Picture
A Mixed Rectangle with keyword polybius and alphabet including a space, and a full stop, comma, question mark and exclamation mark

Previous Page: Fractionating Ciphers
Next Page: Straddling Checkerboard
Information
  • About Me
  • Contact Me
  • Legal
  • Glossary
  • Help with Activities
  • Educational Uses
  • Downloadble Resources
Crypto Corner is a subsiduary of www.interactive-maths.com
©2013 - 2022 Daniel Rodriguez-Clark
All rights reserved
If you have found Crypto Corner useful, then please help to keep it a free site by donating using the button below. Thanks!
  • Home
    • Crypto Corner Challenges
    • Glossary
    • Help with Activities
    • Educational Uses
    • Downloadable Resources
  • Introduction to Cryptography
    • Steganography
    • Codes and Ciphers
    • Conventions in Cryptography
  • Monoalphabetic Substitution Ciphers
    • Atbash Cipher
    • Pigpen Cipher
    • Caesar Shift Cipher
    • Affine Cipher
    • Mixed Alphabet Cipher
    • Other Examples
    • Frequency Analysis: Breaking the Code
    • Homophonic Substitution
  • Simple Transposition Ciphers
    • Rail Fence Cipher
    • Route Cipher
    • Columnar Transposition Cipher
    • Myszkowski Transposition Cipher
    • Permutation Cipher
    • Anagramming: Jumbling words
    • Combining Monoalphabetic and Simple Transposition Ciphers
  • Polyalphabetic Substitution Ciphers
    • Vigenère Cipher
    • Kasiski Analysis: Breaking the Code
    • Autokey Cipher
    • Other Examples
  • Fractionating Ciphers
    • Polybius Square
    • Straddling Checkerboard
    • Transposing Fractionated Text
    • Other ways to Alter Fractionated Text
  • Digraph Substitution Ciphers
    • Playfair Cipher
    • Two-Square Cipher
    • Four-Square Cipher
    • Hill Cipher