Polybius square

Last updated
The Greek letters of a Polybius square Polybius square.png
The Greek letters of a Polybius square

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. [1] 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 device was originally used for fire signalling, allowing for the coded transmission of any message, not just a finite number of predetermined options as was the convention before. [1]

Contents

Basic form

According to Polybius' Histories, the device was invented by Cleoxenus and Democleitus, and further developed by Polybius himself. The device partitioned the alphabet into five tablets with five letters each (except for the last one with only four). There are no surviving tablets from antiquity. Letters are represented by two numbers from one to five, allowing the representation of 25 characters using only 5 numeric symbols.

The original square used the Greek alphabet laid out as follows:

12345
1 Α Β Γ Δ Ε
2 Ζ Η Θ Ι Κ
3 Λ Μ Ν Ξ Ο
4 Π Ρ Σ Τ Υ
5 Φ Χ Ψ Ω

Modern Greek still uses that same alphabet, as do implementations of the Polybius square in that language.

With the Latin alphabet, this is the typical form:

12345
1 A B C D E
2 F G H I/J K
3 L M N O P
4 Q R S T U
5 V W X Y Z

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.

Each letter is then represented by its coordinates in the grid. For example, "BAT" becomes "12 11 44". 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). Alternatively, a 6 × 6 grid may be used to allow numerals or special characters to be included as well as letters.

A 6 × 6 grid is also usually used for the Cyrillic alphabet (the most common variant has 33 letters, but some have up to 37) [ citation needed ] or Japanese hiragana (see cryptography in Japan).

A 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. [2] For example, the key phrase "polybius cipher" would lead to the reordered square below.

12345
1POLYB
2I/JUSCH
3ERADF
4GKMNQ
5TVWXZ

Encryption Principle

There are several encryption methods using the Polybius square. Three of them are described below.

12345
1 A B C D E
2 F G H I/J K
3 L M N O P
4 Q R S T U
5 V W X Y Z

Method 1

Let's encrypt the word "SOMETEXT" with a Caesar cipher using a shift equal to the side of our square (5). To do it, locate the letter of the text and insert the one immediately below it in the same column for the ciphertext. If the letter is in the bottom row, take the one from the top of the same column.

Letter of the textsometext
Cipher text letterxtrkykcy

Thus, after encryption, we get:

Before encryption:sometext
After encryption:xtrkykcy

Method 2

A more complicated method involves a Bifid cipher without a key (or, in other words, with a key of plain alphabet):

12345
1 A B C D E
2 F G H I/J K
3 L M N O P
4 Q R S T U
5 V W X Y Z

The message is transformed into coordinates on the Polybius square, and the coordinates are recorded vertically:

Lettersometext
Horizontal coordinate:34254534
Vertical coordinate:43314154


Then the coordinates are read row by row:

34  25  45  34  43  31  41  54  

Next, the coordinates are converted into letters using the same square:

Horizontal coordinate:32434345
Vertical coordinate:45543114
Letterswysocdu

Thus, after encryption, we get:

Before encryption:sometext
After encryption:swysocdu

Method 3

12345
1 A B C D E
2 F G H I/J K
3 L M N O P
4 Q R S T U
5 V W X Y Z

An advanced variation, which involves the following: the obtained primary ciphertext (result From Method2) is encrypted again. In this case, it is written out without being split into pairs.

3425453443314154

The resulting sequence of digits is cyclically shifted to the left by one step (an odd number of steps (move 3 to the end)):

4254534433141543

This sequence is again divided into groups of two:

42 54 53 44 33 14 15 43

And is replaced with the final ciphertext according to the table:

Horizontal coordinate:45543114
Vertical coordinate:24343453
Letteriuptnqvo

Thus, after encryption, we get:

Before encryption:sometext
After encryption:iuptnqvo


Applications

Telegraphy

Diagram of a fire signal using the Polybius cipher Torches.png
Diagram of a fire signal using the Polybius cipher

In his Histories, Polybius outlines the need for effective signalling in warfare, leading to the development of the square. Previously, fire-signalling was useful only for expected, predetermined messages, with no way to convey novel messages about unexpected events. [1] 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". [1] This system was slightly better than the basic fire-signalling, but still lacked the ability to convey any needed message. The Polybius square was used to aid in telegraphy, specifically fire-signalling. 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. [1] 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. 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. [1] Both parties would need the same tablets, a telescope (a tube to narrow view, no real magnification), and torches. [1]

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. [2] 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. [3]

Arthur Koestler describes the code being used by political prisoners of Stalin in the 1930s in his anti-totalitarian novel Darkness at Noon . (Koestler had been a prisoner-of-war during the Spanish Civil War.) 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. However, it is also somewhat less efficient than more complex codes.

Steganography

The simple representation also lends itself to steganography. 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. [3]

Cryptography

The Polybius square is also used as a basic cipher called the Polybius cipher. This cipher is quite insecure by modern standards, as it is a substitution cipher with characters being substituted for pairs of digits, which is easily broken through frequency analysis. [2]

Adaptations

The Polybius square and the Polybius cipher can be combined with other cryptographic methods such as the ADFGVX cipher, [2] Homophonic cipher [2] and more.

Hybrid Polybius Playfair cipher

The Playfair cipher is a polyalphabetic substitution cipher invented by Charles Wheatstone and promoted by Lyon Playfair based on a 5 x 5 square which accommodates the alphabet in a manner similar to the Polybius square. The letters in the square are arranged by first inserting the letters of a key (without repetition), before the remaining letters (which appear subsequently in normal alphabetical order). A message is divided into pairs of letters, with a filler letter "x" inserted at the end if the message was of odd length. If both letters of a pair are the same, a filler "x" is inserted between them with an extra "x" inserted at the end of the message to compensate for this. Each pair of letters are then encrypted using the Playfair key table through "mapping rules". [4]

The mapping rules are:

1. If the letters of the pair appear in the same row of the table, replace them with the letters to their immediate right respectively (if a letter of the plaintext pair is the rightmost letter in the row, wrap around to the left side of the row).

2. If the letters of the pair appear in the same column of the table, replace them with the letters immediately below respectively (if a letter in the plaintext pair is on the bottom of the column, wrap around to the top of the column).

3. If the letters of the pair are not on the same row or column, replace them with the letters in the same row of the letter and on the column of the other letter of the pair. The order here is important: the first letter of the encrypted pair is the one that sits in the same row as the first letter and on the column of the second letter of the plaintext pair.

Table for a Playfair cipher using key 'playfair'
PLAYF
I/JRBCD
EGHKM
NOQST
UVWXZ


Plaintext message:  HELLO WORLD

Playfair message:  HE  LX  LO  WO  RL  DX

Playfair cipher:  KG  YV  RV  VQ  GR  CZ

The decryption rules are the same as the encryption. The cipher message is mapped with the same Playfair matrix for decryption, and gives the plaintext message back.

For a hybrid Polybius-Playfair cipher, a new and bigger table is used, with messages being encrypted and decrypted twice. The plaintext is encrypted using the Playfair cipher first, and then using the Polybius cipher.

Table for a hybrid cipher with key 'playfair'
12345
1PLAYF
2I/JRBCD
3EGHKM
4NOQST
5UVWXZ

Plaintext message:  HELLO WORLD

Playfair message:  HE  LX  LO  WO  RL  DX

Playfair cipher:  KG  YV  RV  VQ  GR  CZ

Polybius cipher:  3432  1452  2252  5243  3222  2455

See also

Related Research Articles

<span class="mw-page-title-main">Cipher</span> Algorithm for encrypting and decrypting information

In cryptography, a cipher is an algorithm for performing encryption or decryption—a series of well-defined steps that can be followed as a procedure. An alternative, less common term is encipherment. To encipher or encode is to convert information into cipher or code. In common parlance, "cipher" is synonymous with "code", as they are both a set of steps that encrypt a message; however, the concepts are distinct in cryptography, especially classical cryptography.

<span class="mw-page-title-main">One-time pad</span> Encryption technique

In cryptography, the one-time pad (OTP) is an encryption technique that cannot be cracked, but requires the use of a single-use pre-shared key that is larger than or equal to the size of the message being sent. In this technique, a plaintext is paired with a random secret key. Then, each bit or character of the plaintext is encrypted by combining it with the corresponding bit or character from the pad using modular addition.

In cryptography, a substitution cipher is a method of encrypting in which units of plaintext are replaced with the ciphertext, in a defined manner, with the help of a key; the "units" may be single letters, pairs of letters, triplets of letters, mixtures of the above, and so forth. The receiver deciphers the text by performing the inverse substitution process to extract the original message.

<span class="mw-page-title-main">Transposition cipher</span> Method of encryption

In cryptography, a transposition cipher is a method of encryption which scrambles the positions of characters (transposition) without changing the characters themselves. Transposition ciphers reorder units of plaintext according to a regular system to produce a ciphertext which is a permutation of the plaintext. They differ from substitution ciphers, which do not change the position of units of plaintext but instead change the units themselves. Despite the difference between transposition and substitution operations, they are often combined, as in historical ciphers like the ADFGVX cipher or complex high-quality encryption methods like the modern Advanced Encryption Standard (AES).

<span class="mw-page-title-main">Caesar cipher</span> Simple and widely known encryption technique

In cryptography, a Caesar cipher, also known as Caesar's cipher, the shift cipher, Caesar's code, or Caesar shift, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence.

<span class="mw-page-title-main">Vigenère cipher</span> Simple type of polyalphabetic encryption system

The Vigenère cipher is a method of encrypting alphabetic text where each letter of the plaintext is encoded with a different Caesar cipher, whose increment is determined by the corresponding letter of another text, the key.

<span class="mw-page-title-main">Autokey cipher</span> Classic polyalphabet encryption system

An autokey cipher is a cipher that incorporates the message into the key. The key is generated from the message in some automated fashion, sometimes by selecting certain letters from the text or, more commonly, by adding a short primer key to the front of the message.

<span class="mw-page-title-main">Tabula recta</span> Fundamental tool in cryptography

In cryptography, the tabula recta is a square table of alphabets, each row of which is made by shifting the previous one to the left. The term was invented by the German author and monk Johannes Trithemius in 1508, and used in his Trithemius cipher.

In cryptography, coincidence counting is the technique of putting two texts side-by-side and counting the number of times that identical letters appear in the same position in both texts. This count, either as a ratio of the total or normalized by dividing by the expected count for a random source model, is known as the index of coincidence, or IC for short.

<span class="mw-page-title-main">Playfair cipher</span> Early block substitution cipher

The Playfair cipher or Playfair square or Wheatstone–Playfair cipher is a manual symmetric encryption technique and was the first literal digram substitution cipher. The scheme was invented in 1854 by Charles Wheatstone, but bears the name of Lord Playfair for promoting its use.

<span class="mw-page-title-main">Ciphertext</span> Encrypted information

In cryptography, ciphertext or cyphertext is the result of encryption performed on plaintext using an algorithm, called a cipher. Ciphertext is also known as encrypted or encoded information because it contains a form of the original plaintext that is unreadable by a human or computer without the proper cipher to decrypt it. This process prevents the loss of sensitive information via hacking. Decryption, the inverse of encryption, is the process of turning ciphertext into readable plaintext. Ciphertext is not to be confused with codetext because the latter is a result of a code, not a cipher.

A straddling checkerboard is a device for converting an alphanumeric plaintext into digits whilst simultaneously achieving fractionation and data compression relative to other schemes using digits. It also is known as a monôme-binôme cipher.

The affine cipher is a type of monoalphabetic substitution cipher, where each letter in an alphabet is mapped to its numeric equivalent, encrypted using a simple mathematical function, and converted back to a letter. The formula used means that each letter encrypts to one other letter, and back again, meaning the cipher is essentially a standard substitution cipher with a rule governing which letter goes to which. As such, it has the weaknesses of all substitution ciphers. Each letter is enciphered with the function (ax + b) mod 26, where b is the magnitude of the shift.

In cryptography, the ADFGVX cipher was a manually applied field cipher used by the Imperial German Army during World War I. It was used to transmit messages secretly using wireless telegraphy. ADFGVX was in fact an extension of an earlier cipher called ADFGX which was first used on 1 March 1918 on the German Western Front. ADFGVX was applied from 1 June 1918 on both the Western Front and Eastern Front.

In classical cryptography, the bifid cipher is a cipher which combines the Polybius square with transposition, and uses fractionation to achieve diffusion. It was invented around 1901 by Felix Delastelle.

In cryptography, a classical cipher is a type of cipher that was used historically but for the most part, has fallen into disuse. In contrast to modern cryptographic algorithms, most classical ciphers can be practically computed and solved by hand. However, they are also usually very simple to break with modern technology. The term includes the simple systems used since Greek and Roman times, the elaborate Renaissance ciphers, World War II cryptography such as the Enigma machine and beyond.

In cryptanalysis, Kasiski examination is a method of attacking polyalphabetic substitution ciphers, such as the Vigenère cipher. It was first published by Friedrich Kasiski in 1863, but seems to have been independently discovered by Charles Babbage as early as 1846.

The four-square cipher is a manual symmetric encryption technique. It was invented by the French cryptographer Felix Delastelle.

The Two-square cipher, also called double Playfair, is a manual symmetric encryption technique. It was developed to ease the cumbersome nature of the large encryption/decryption matrix used in the four-square cipher while still being slightly stronger than the single-square Playfair cipher.

<span class="mw-page-title-main">BATCO</span> British paper cryptographic system

BATCO, short for Battle Code, is a hand-held, paper-based encryption system used at a low, front line level in the British Army. It was introduced along with the Clansman combat net radio in the early 1980s and was largely obsolete by 2010 due to the wide deployment of the secure Bowman radios. BATCO consists of a code, contained on a set of vocabulary cards, and cipher sheets for superencryption of the numeric code words. The cipher sheets, which are typically changed daily, also include an authentication table and a radio call sign protection system.

References

  1. 1 2 3 4 5 6 7 "Polybius • Histories — Book 10". penelope.uchicago.edu. Retrieved 2020-04-13.
  2. 1 2 3 4 5 Salomon, D. (David), 1938- (2011). Data privacy and security : encryption and information hiding. Springer. ISBN   978-1-4419-1816-1. OCLC   752480143.{{cite book}}: CS1 maint: multiple names: authors list (link) CS1 maint: numeric names: authors list (link)
  3. 1 2 Daniel Rodriguez-Clark. "Cryptography Worksheet — Polybius Square" (PDF). Crypto Corner. pp. 1–3. 
  4. Kumar, Chandan (August 2015). [Researchgate.net "A Hybrid Polybius-Playfair Music Cipher"]. International Journal of Multimedia and Ubiquitous Engineering.{{cite journal}}: Check |url= value (help)