

The Polybius square is also used as a basic cipher called the Polybius cipher. The figures from one to five can be indicated by knots in a string, stitches on a quilt, contiguous letters before a wider space or many other ways. The simple representation also lends itself to steganography. However, it is also somewhat less efficient than more complex codes. Indeed, it can be signalled in many simple ways (flashing lamps, blasts of sound, drums, smoke signals) and is much easier to learn than more sophisticated codes like the Morse code. (Koestler had been a prisoner-of-war during the Spanish Civil War.)
#Polybius square encyripter matlab code#
Īrthur Koestler describes the code being used by political prisoners of Stalin in the 1930s in his anti-totalitarian novel Darkness at Noon. It is said to have been used by nihilist prisoners of the Russian Czars and also by US prisoners of war during the Vietnam War. The Polybius square has also been used in the form of the " knock code" to signal messages between cells in prisons by tapping the numbers on pipes or walls. Both parties would need the same tablets, a telescope (a tube to narrow view, no real magnification), and torches. The sender would then raise a set of torches on his right side to indicate which letter on the tablet was intended for the message. The sender would then hold up the first set of torches on his left side to indicate to the recipient which tablet (or row of the square) was to be consulted. To send a message, the sender would initially hold up two torches and wait for the recipient to do the same to signal that they were ready to receive the message. The Polybius square was used to aid in telegraphy, specifically fire-signalling. This system was slightly better than the basic fire-signalling, but still lacked the ability to convey any needed message. According to Polybius, in the 4th century BCE, Aeneas Tacticus devised a hydraulic semaphore system consisting of matching vessels with sectioned rods labelled with different messages such as "Heavy Infantry", "Ships", and "Corn". Previously, fire-signalling was useful only for expected, predetermined messages, with no way to convey novel messages about unexpected events. In his Histories, Polybius outlines the need for effective signalling in warfare, leading to the development of the square. For example, the key phrase " polybius cipher" would lead to the reordered square below.Īpplications Telegraphy Diagram of a fire signal using the Polybius cipher Alternatively, a 6 × 6 grid may be used to allow numerals or special characters to be included as well as letters.Ī 6 × 6 grid is also usually used for the Cyrillic alphabet (the most common variant has 33 letters, but some have up to 37) or Japanese hiragana (see cryptography in Japan).Ī key could be used to reorder the alphabet in the square, with the letters (without duplicates) of the key being placed at the beginning and the remaining letters following it in alphabetical order. The 26 letters of the Latin/English alphabet do not fit in a 5 × 5 square, two letters must be combined (usually I and J as above, though C and K is an alternative). This alphabet, and this latter form of the Polybius square, is used when implementing the square in other Western European languages such as English, Spanish, French, German, Italian, Portuguese, and Dutch.Įach letter is then represented by its coordinates in the grid. With the Latin alphabet, this is the typical form:

Modern Greek still uses that same alphabet, as do implementations of the Polybius square in that language. The original square used the Greek alphabet laid out as follows: Letters are represented by two numbers from one to five, allowing the representation of 25 characters using only 5 numeric symbols. There are no surviving tablets from antiquity. The device partitioned the alphabet into five tablets with five letters each (except for the last one with only four). Basic form Īccording to Polybius' Histories, the device was invented by Cleoxenus and Democleitus, and further developed by Polybius himself. The device was originally used for fire signalling, allowing for the coded transmission of any message, not just a finite amount of predetermined options as was the convention before. The device is used for fractionating plaintext characters so that they can be represented by a smaller set of symbols, which is useful for telegraphy, steganography, and cryptography. The Polybius square, also known as the Polybius checkerboard, is a device invented by the ancient Greeks Cleoxenus and Democleitus, and made famous by the historian and scholar Polybius. Type of code The Greek letters of a Polybius square
