Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Lecture



Simple substitution cipher, simple substitutional cipher, monoalphabetic cipher — a class of encryption methods that come down to building, according to some defined algorithm, a substitution table in which each letter of the plaintext is mapped to a single corresponding ciphertext letter. Encryption itself consists in replacing letters according to the table. To decrypt, it is enough to have the same table, or to know the algorithm by which it is generated.

Simple substitution ciphers include many encryption methods that arose in antiquity or the Middle Ages, such as Atbash (also transliterated as Athbash) or the Caesar cipher. Frequency cryptanalysis is used to break such ciphers.

It is a special case of the substitution cipher.

Note that a simple substitution cipher does not always mean replacing a letter with some other letter. It is also permitted to replace a letter with a number. For example, consider a certain cipher alphabet: А - 33; Б - 17; В - 8; Г - 16; Д - 2; Е - 15; Ё - 14; Ж - 13; З - 73; И - 98; Й - 10; К - 97; Л - 96; М - 24; Н - 0; О - 11; П - 5; Р - 25; С - 7; Т - 3; У - 64; Ф - 26; Х - 66; Ц - 69; Ч - 4; Ш - 6; Щ - 36; Ь - 21; Ъ - 22; Ы - 23; Э - 37; Ю - 39; Я - 18.

This cipher uses numbers to replace letters. There is no logic to these numbers. Such a simple cipher can be decrypted only by having the cipher table.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.2. Classification of substitution ciphers

The figure highlights in grey the subgroups of ciphers that do not form a complete higher-level group of ciphers but have nonetheless become widely used in practice and are described in this article.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 8

Let us comment on the diagram above. Note that the arrows leading out of any box in the diagram point only to the most significant specific subclasses of ciphers. The dashed arrows leading from the subclasses of permutation ciphers indicate that these ciphers can also be regarded as block substitution ciphers, since the plaintext is divided during encryption into fixed-length blocks, within each of which some permutation of letters is performed. Monoalphabetic and polyalphabetic ciphers can be either stream or block ciphers. At the same time, keystream ciphers, which form a subclass of polyalphabetic ciphers, belong to stream rather than block ciphers. Moreover, they are symmetric rather than asymmetric ciphers.

The following table gives a brief characterisation of the types of substitution ciphers.

Table 5.1. Types of substitution ciphers

Cipher type Brief characterisation Examples of ciphers
unambiguous substitution
(monoalphabetic,
simple substitutional)
The number of cipher substitutes M for each symbol or block of symbols of the source alphabet equals 1 (| Mi | = 1 for a single i-th symbol or block of symbols).
unambiguous
substitution
regular The cipher substitutes consist of the same number of symbols, or are separated from one another by a delimiter (a space, a period, a dash, etc.). Caesar cipher,
keyword cipher,
prison cipher
regular polygram The cipher substitute corresponds to a block of symbols of the source alphabet (| Mi | = 1 for a single i-th block of symbols). Porta bigram cipher,
Hill cipher
asymmetric
deterministic
Encrypting the same plaintext message with the same public key will always produce the same ciphertext. That is, for a given public key, the same symbol (block of symbols) of the plaintext message will always be represented by the same cipher substitute. RSA,
cipher based on the knapsack problem
irregular The cipher substitutes consist of varying numbers of symbols, written without delimiters. combined cipher
ambiguous substitution The number of cipher substitutes M for individual symbols or a block of symbols of the source alphabet is greater than 1 (| Mi | ≥ 1 for a single i-th symbol or block of symbols).
ambiguous
substitution
homophonic
(homophone)
The cipher substitutes for different symbols or blocks of symbols of the source alphabet do not repeat (MI ∩ MJ = Ø for two different i-th and j-th symbols or blocks of symbols). homophone system,
book cipher
polyalphabetic
(multi-alphabet)
The source alphabet used to write plaintext messages corresponds to several cipher-substitute alphabets. The choice of the cipher-substitute alphabet used to encrypt a given symbol or block of symbols depends on the specifics of the cipher. The same cipher substitute can be used for different symbols or blocks of symbols of the source alphabet (MI ∩ MJ ≠ Ø for two different i-th and j-th symbols or blocks of symbols). Alberti disk,
Vigenère system
polyalphabetic additive
(keystream)
During encryption, symbols of the source alphabet in the plaintext message are replaced by numbers, to which numbers from a secret random numeric sequence (the keystream) are added, after which the remainder of division modulo is taken (the mod operation). encryption by addition modulo N,
Vernam cipher
quantum These are a variant of keystream ciphers in which elementary particles (beams of elementary particles) are used as information carriers.
asymmetric
probabilistic
Encrypting the same plaintext message with the same public key can produce different ciphertexts. That is, for a given public key, the same symbol (block of symbols) of the plaintext message can be represented by different cipher substitutes. This is achieved by using a random value when encrypting a symbol (block of symbols), which is equivalent to switching between cipher-substitute alphabets. ElGamal scheme,
elliptic-curve-based cipher

5.2. Regular unambiguous substitution ciphers

The maximum number of keys for any cipher of this type does not exceed n!, where n – the number of symbols in the alphabet. For large n, Stirling's formula can be used to approximate n!.

The Caesar cipher. According to the accounts of the historian Suetonius in the book “The Life of the Twelve Caesars”, this cipher was used by Gaius Julius Caesar for secret correspondence with his generals (1st century BC) [44]. Applied to the Russian language, its essence is as follows. The source alphabet is written out (А, Б, ..., Я), then below it the same alphabet is written out again, but cyclically shifted 3 letters to the left.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.3. Substitution table for the Caesar cipher

When encrypting, the letter А is replaced by the letter Г, Б - by Д, and so on. For example, the plaintext message “АБРАМОВ” becomes “ГДУГПСЕ” after encryption. The recipient of the message “ГДУГПСЕ” looks up these letters in the bottom row and, using the letters above them, recovers the original message “АБРАМОВ”.

The key in the Caesar cipher is the amount by which the bottom row of the alphabet is shifted. The number of keys for all modifications of this cipher, applied to the Russian alphabet, equals 33. There are various modifications of the Caesar cipher, in particular Atbash and the keyword cipher.

Atbash. The Old Testament contains several passages from sacred texts that are encrypted using a substitution cipher called Atbash. This cipher consists in replacing each letter with another letter that is the same distance from the end of the alphabet as the original letter is from the beginning. For example, in the Russian alphabet the letter А is replaced by Я, the letter Б by Ю, and so on. The original Old Testament used letters of the Hebrew alphabet. Thus, in the Book of Jeremiah (25:26) the word “Babel” (Babylon) is enciphered as “Sheshach” [44].

Keyword cipher. For this cipher, the substitution table is built from a keyword (key) – an easily remembered word. The second row of the substitution table is filled first with the keyword itself (with repeated letters discarded), and then with the remaining letters not included in the keyword, in alphabetical order. For example, if the keyword “ДЯДИНА” is chosen, the table looks as follows.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.4. Substitution table for the keyword cipher

When the plaintext message “АБРАМОВ” is encrypted using the key given above, the ciphertext becomes “ДЯПДКМИ”.

It is recommended to choose as the keyword a phrase that contains the final letters of the alphabet. In general, the number of possible variants of the bottom row (as applied to the Russian language) is 33! (≥ 1035).

The Polybius square. The cipher was invented by the Greek statesman, general and historian Polybius (203-120 BC). Applied to the Russian alphabet and Hindu (Arabic) numerals, the essence of the encryption was as follows. Letters are written into a 6×6 square (not necessarily in alphabetical order).

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.5. Substitution table for the Polybius square

The letter being encrypted is replaced by the coordinates of the square (row-column) in which it is written. For example, if the plaintext message is “АБРАМОВ”, then the ciphertext – “11 12 36 11 32 34 13”. In Ancient Greece, messages were transmitted using an optical telegraph (by means of torches). For each letter of the message, first the number of torches corresponding to the letter's row number was raised, and then the number corresponding to its column.

The prison cipher [43]. This audible variant of the Polybius square was devised by prisoners. The system consisted of a number of taps denoting the rows and columns in the table of alphabet letters. One tap, followed by two more, corresponded to row 1 and column 2, i.e. the letter Б. A pause served as the delimiter between rows and columns. Thus, the plaintext message “АБРАМОВ” can be enciphered as follows.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.6. Example of using the prison cipher

The Trithemius (Tritemius) cipher system. In 1508, the German abbot Johannes Trithemius wrote a printed work on cryptology titled “Polygraphiae”. In this book he was the first to systematically describe the use of cipher tables filled with the alphabet in random order. To obtain such a substitution cipher, a table for writing the alphabet letters and a keyword (or phrase) were typically used. The keyword was first written into the table row by row, with repeated letters discarded. The table was then filled out with the remaining letters of the alphabet not yet included, in order. Fig. 5.7 shows the table with the keyword “ДЯДИНА”.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.7. Substitution table for the Trithemius cipher

Each letter of the plaintext message is replaced by the letter located beneath it in the same column. If a letter is in the last row of the table, the topmost letter of the column is used to encrypt it. For example, the plaintext message “АБРАМОВ”, enciphered – “ЖЗЦЖУФЙ”.

The Masonic cipher [43]. In the 18th century, the Freemasons created a cipher to hide their commercial dealings from the public. According to those who once belonged to this society, the Freemasons used a method of secrecy very similar to the Rosicrucian cipher. In the “grid” and at the corners there are dots that replace letters:

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.8. Cipher substitutes of the Masonic cipher

Since oaths of secrecy have been broken more than once, most Grand Lodges of Freemasons in the USA no longer use written ciphers, preferring to convey instructions orally during closed rituals.

Using the Masonic cipher, the following phrase can easily be decrypted.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.9. Example of using the Masonic cipher

This is the first level, in which all members newly admitted to the society are found: the Blue Lodge (literally “the Light-Blue (Blue) Lodge”).

One of the significant drawbacks of unambiguous substitution ciphers is how easily they can be broken. Various techniques are used to break ciphertexts, which can achieve positive results even without powerful computational resources. One such technique is based on the fact that ciphertexts retain information about the frequency with which letters occur in the source text. If a particular letter occurs frequently in the plaintext message, then the corresponding symbol will also occur frequently in the encrypted message. As early as 1412, al-Qalqashandi, in his work “Dawn for the Short-Sighted in the Art of Writing”, presented a table of the frequency of occurrence of Arabic letters in text, based on an analysis of the text of the Quran. Similar tables exist for various languages of the world. For example, for the letters of the Russian alphabet, according to data from the "Russian National Corpus", such a table looks as follows [17].

Table 5.2. Frequency of occurrence of Russian letters in texts

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Similar tables exist for pairs of letters (bigrams). For example, common bigrams include “то”, “но”, “ст”, “по”, “ен”, etc. Another technique for breaking ciphertexts is based on excluding impossible letter combinations. For example, in texts (if written without spelling errors) one cannot find the combinations “чя”, “щы”, “ьъ”, and so on.

To make the task of breaking unambiguous substitution ciphers more difficult, spaces and/or vowels were excluded from plaintext messages before encryption as far back as antiquity. Another method that hinders decryption is encryption using bigrams (pairs of letters).

5.3. Polygram ciphers

Polygram ciphers - ciphers in which a single cipher substitute corresponds to several symbols of the plaintext message at once.

Porta's bigram cipher [43]. Porta's cipher, presented by him in the form of a table, is the first known bigram cipher. His table measured 20 by 20 cells; the standard alphabet was written horizontally along the top and vertically along the left side (it did not include the letters J, K, U, W, X and Z). Any numbers, letters or symbols could be written in the table's cells - Giovanni della Porta himself used symbols - provided that the contents of no two cells repeated. Applied to the Russian language, the substitution table might look as follows.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.10. Substitution table for Porta's cipher

Encryption is performed in pairs of letters of the plaintext message. The first letter of the pair indicates the row of the cipher substitute, the second - the column. If the plaintext message contains an odd number of letters, an auxiliary symbol (“null symbol”) is added to it. For example, the plaintext message “АБ РА МО В”, enciphered – “002 466 355 093”. The letter “Я” is used as the auxiliary symbol.

The Playfair cipher (English “fair play”). In the early 1850s, Charles Wheatstone invented the so-called “rectangular cipher”. Lyon Playfair, a close friend of Wheatstone's, described this cipher during an official dinner in 1854 to the Home Secretary, Lord Palmerston, and Prince Albert. Since Playfair was well known in military and diplomatic circles, the name “Playfair cipher” became permanently attached to Wheatstone's creation.

This cipher was the first letter-based bigram cipher (Porta's bigram table used symbols rather than letters). It was designed to ensure the secrecy of telegraph communications and was used by British forces in the Anglo-Boer War and the First World War. It was also used by the Australian coastwatch service during the Second World War.

The cipher provides for the encryption of pairs of symbols (bigrams). This makes the cipher more resistant to breaking compared with a simple substitution cipher, since frequency analysis is made more difficult. It can still be carried out, but not for 26 possible symbols (the Latin alphabet), but for 26 × 26 = 676 possible bigrams. Frequency analysis of bigrams is possible, but is considerably more difficult and requires a much larger volume of ciphertext.

To encrypt a message, it must be split into bigrams (groups of two symbols); if a bigram happens to contain two identical symbols, a predetermined auxiliary symbol is inserted between them (in the original – X, for the Russian alphabet - Я). For example, “зашифрованное сообщение” (Russian for an encrypted message) becomes “за ши фр ов ан но ес оЯ об ще ни еЯ”. To build the key table, a keyword is chosen, and the table is then filled in according to the rules of the Trithemius cipher system. For example, for the keyword “ДЯДИНА”, the key table looks as follows.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.11. Key table for the Playfair cipher

Then, following the rules below, the pairs of symbols of the source text are encrypted:

1. If the symbols of a bigram of the source text occur in the same row, these symbols are replaced by the symbols located in the nearest columns to the right of the corresponding symbols. If a symbol is the last one in the row, it is replaced by the first symbol of that same row.

2. If the symbols of a bigram of the source text occur in the same column, they are converted into the symbols of that same column located directly beneath them. If a symbol is the bottom one in the column, it is replaced by the first symbol of that same column.

3. If the symbols of a bigram of the source text are in different columns and different rows, they are replaced by the symbols located in the same rows but corresponding to the other corners of the rectangle.

Example of encryption.

  • - the bigram “за” forms a rectangle – it is replaced by “жб”;
  • - the bigram “ши” is in the same column – it is replaced by “юе”;
  • - the bigram “фр” is in the same row – it is replaced by “хс”;
  • - the bigram “ов” forms a rectangle – it is replaced by “йж”;
  • - the bigram “ан” is in the same row – it is replaced by “ба”;
  • - the bigram “но” forms a rectangle – it is replaced by “ам”;
  • - the bigram “ес” forms a rectangle – it is replaced by “гт”;
  • - the bigram “оя” forms a rectangle – it is replaced by “ка”;
  • - the bigram “об” forms a rectangle – it is replaced by “па”;
  • - the bigram “ще” forms a rectangle – it is replaced by “шё”;
  • - the bigram “ни” forms a rectangle – it is replaced with “ан”;
  • - the bigram “ея” forms a rectangle – it is replaced with “ги”.

The cryptogram – “жб юе хс йж ба ам гт ка па шё ан ги”.

To decrypt, the inverse of these rules must be applied, discarding the letters Я (or Х) if they carry no meaning in the original message.

The Hill cipher [17, 43]. The first practically implementable encryption method based on algebra was devised in 1929 by the mathematician Lester Hill, a professor at Hunter College in New York, whose paper “Cryptography in an Algebraic Alphabet” was published in “The American Mathematical Monthly”.

Each letter of the alphabet is assigned a number. For the Russian alphabet, the simplest scheme can be used: А = 0, Б = 1, ..., Я = 32. To encrypt, a block of the plaintext message consisting of n letters is treated as an n-dimensional vector of numbers and multiplied by a matrix of size n x n modulo 33. This matrix, together with the code table mapping the letters of the alphabet to numbers, forms the encryption key. Decryption uses the inverse matrix1 modulo the same value.

For example, the following encryption / decryption matrices can be used for trigram substitutions.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.12. Encryption / decryption matrices

The plaintext message “АБРАМОВ”, padded with two auxiliary letters “яя” (to make it a multiple of three), after mapping the letters to numbers looks like “0 1 17 0 13 15 2 32 32”. After multiplying the triples of numbers by the encryption matrix, the cryptogram takes the form “11 32 8 3 28 17 17 11 24” (or, in letter form, “КЯЗ ГЪР РКЧ”).

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

To decrypt, the triples of numbers in the cryptogram must be multiplied by the decryption matrix.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

The result is the set of numbers “0 1 17 0 13 15 2 32 32”, corresponding to the original message with the auxiliary characters, “АБРАМОВяя”.


1Inverse matrix - the matrix A-1 which, when multiplied by the original matrix A, gives the identity matrix E.

5.4. Irregular ciphers

Another way of increasing the strength of substitution ciphers is to use irregular ciphers. In the ciphers described above (regular ciphers), the cipher substitutes consist of a strictly fixed number of characters (letters, digits, graphic elements, etc.), or in the cryptogram they are separated from one another by special characters (a space, a period, a comma, etc.). In irregular ciphers, the substitutes consist of varying numbers of characters and are written one after another in the cryptogram without any separation, which considerably complicates cryptanalysis.

Combined cipher (combined table) [43]. This cipher was already used by the Argenti family, cryptologists who devised ciphers for the Pope in the 16th century. In the 20th century this method was used by the Communists during the Spanish Civil War. At the start of the war, the opponents of fascism in Spain controlled most of the major cities and protected their communications, including radio transmissions, using various encryption methods, including combined ciphers.

The Communists' variant was called “combined” because of its unusual use of one- and two-digit substitutes, which gave the message extra protection against a potential codebreaker. Some letters were enciphered with a single digit, others with a pair of digits. This meant the enemy cryptanalyst had no idea at all which digits in the intercepted messages were single-digit substitutes and which were two-digit ones.

The substitution table consists of 10 columns numbered 0, 9, 8, 7, 6, 5, 4, 3, 2 and 1. A keyword without repeated letters is written into the first row. The remaining rows are filled with the ten letters not included in the keyword, in alphabetical order. The rows, except for the first, are numbered in order starting from 1.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.13. Example of a combined-cipher substitution table with the keyword “ДЯДИНА”

When encrypting, letters of the plaintext message that are part of the keyword are replaced by a single digit (the column number); the rest – by two (the row and column numbers). For example, using the substitution table above, the plaintext message “АБРАМОВ” would be encrypted as “610276202919”.

On receiving a cryptogram, the recipient knows that whenever the digits 1, 2 or 3 appear, another digit must necessarily go with them, since together they form a digit pair. So 35 is undoubtedly a pair, whereas 53 is not, since there is no row numbered 5 in the table. If a third party intercepts such a message, all they get is a string of digits, because the enemy cryptanalyst has no idea which digits are single and which belong to pairs.

5.5. Homophonic ciphers

Another way to increase the strength of substitution ciphers is to make each set of cipher designations Mi for an individual i-th symbol of the plaintext alphabet contain more than one element. When such a cipher is used, the same letter (if it occurs several times in the message) is replaced by different substitutes from Mi. This makes it possible to hide the true frequency of occurrence of the letters of the plaintext message.

The homophone system. In 1401, Simeone de Crema began using tables of homophones to conceal the frequency of occurrence of vowels in a text by using more than one substitute. Such ciphers later came to be called polyphonic substitution ciphers or homophones2. They developed further in the 15th century. In the book “Treatise on Ciphers” by Leon Battista Alberti (an Italian scholar, architect, art theorist, and secretary to Pope Clement XII), published in 1466, a substitution cipher is described in which each letter is assigned several equivalents, the number of which is proportional to the letter's frequency of occurrence in the plaintext. Thus, going by Table 5.2, the number of substitutes for the letter О should be 110, for the letter Е – 85, and so on. Each substitute must consist of 3 digits, and their total number is 1000. Fig. 5.12 shows a fragment of the substitution table.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.14. Fragment of the substitution table for the homophone system

When encrypting, a symbol of the plaintext message is replaced by any substitute from its column. If a symbol occurs again, different substitutes are normally used. For example, the plaintext message “АБРАМОВ” might look like “357 990 374 678 037 828 175” after encryption.

Book cipher. [14] A notable contribution to cryptography by the Greek scholar Aeneas Tacticus was his so-called book cipher, described in his work “On the Defence of Fortified Places”. Aeneas proposed pricking inconspicuous holes in a book or other document above the letters of the secret message. Interestingly, in the First World War German spies used a similar cipher, replacing the holes with dots made with invisible ink3 above the letters of newspaper text. These methods of transmitting secret messages (using dots) belong to the steganographic methods of concealing information.

After the First World War, the book cipher took on a different form. The substitute for each letter was defined by a set of digits indicating the page number, the line, and the position within the line.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

a) the key
(volume 4 of the collected works of Friedrich Schiller)

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

b) the cryptogram

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

c) the message

Fig. 5.15. Example of the use of a book cipher (stills from the Soviet TV series “Seventeen Moments of Spring”)

The number of books published in the entire history of humankind is a finite quantity (certainly far fewer than 15!). However, the absence of a complete electronic database of publications makes the task of breaking such cryptograms almost impossible.

Variant ciphers [43]. Variant ciphers resemble the Polybius square, but each row and column uses two letter identifiers. In the square (rectangle) of substitutes, a keyword without repeated letters is written in first, and then it is filled out with the remaining letters in alphabetical order. Each row and column of the square is assigned a pair of letters of the alphabet. The letters used to identify rows and columns must not repeat.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.16. Example of a variant-cipher substitution table with the keyword “ДЯДИНА”

The combinations of the row and column identifier letters give eight substitutes for each letter of the plaintext. For example, for the letter Д the possible substitutes are: ФЙ, ЙФ, ФЦ, ЦФ, ЫЙ, ЙЫ, ЫЦ and ЦЫ. Using the substitution table shown in Fig. 5.16, the plaintext message “АБРАМОВ” can be encrypted as “ЫЗ ЫХ ОЦ ЗФ ГР РЩ АЙ”.


2Homophones (Greek homos - same, and phone - sound) - words that sound the same but are spelled differently and have different meanings.

3Sympathetic (invisible) ink — ink whose writing is invisible at first and becomes visible only under certain conditions (heating, light, a chemical developer, etc.).

5.6. Polyalphabetic ciphers

Polyalphabetic ciphers use several substitution alphabets. The choice of substitution alphabet used to encrypt an individual symbol or block of symbols depends on the specifics of the cipher.

Alberti's disk. In his “Treatise on Ciphers”, Alberti gives the first precise description of a polyalphabetic cipher based on a cipher disk.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.17. Replica of Alberti's disk, used by the Confederacy during the American Civil War [www.cryptomuseum.com]

It consisted of two disks – a fixed outer one and a movable inner one, both marked with the letters of the alphabet. The encryption process consisted of finding the plaintext letter on the outer disk and replacing it with the letter on the inner disk positioned beneath it. The inner disk was then shifted by one position, and the second letter was encrypted using the new cipher alphabet. The key to this cipher was the arrangement of the letters on the disks and the initial position of the inner disk relative to the outer one.

The Trithemius table. One of the ciphers devised by the German abbot Trithemius was a polyalphabetic cipher based on the so-called “Trithemius table” - a table whose side is equal to n, where n – the number of characters in the alphabet. The first row of the matrix contains the letters in their normal alphabetical order; the second row – the same sequence of letters, but cyclically shifted one position to the left; the third row – shifted two positions to the left, and so on.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.18. The Trithemius table

The first row is at the same time the alphabet for the plaintext letters. The first letter of the text is encrypted using the first row, the second letter using the second row, and so on. After the last row has been used, the process returns to the first row again. So the message “АБРАМОВ” becomes “АВТГРУЗ”.

The Vigenère cipher. In 1586, the French diplomat Blaise de Vigenère presented to a commission under Henry III a description of a simple but fairly strong cipher based on the Trithemius table.

Before encryption, a key made up of alphabet symbols is chosen. The encryption procedure itself works as follows. The i-th symbol of the plaintext message in the first row determines the column, and the i-th symbol of the key in the leftmost column – the row. At the intersection of the row and column is the i-th symbol to be placed in the cryptogram. If the key is shorter than the message, it is reused from the start. For example, the plaintext message “АБРАМОВ”, the key – “ДЯДИНА”, the cryptogram – “ДАФИЪОЁ”.

In fairness, it should be noted that this cipher is actually the work of the Italian Giovan Battista Bellaso, who described it in 1553. History “ignored this important fact and named the cipher after Vigenère, even though he did nothing to create it” [13]. Bellaso proposed calling the secret word or phrase a password (Italian password; French parole - word).

In 1863, Friedrich Kasiski published an algorithm for attacking this cipher, although there are known cases of it being broken by skilled cryptanalysts even earlier. In particular, in 1854 the cipher was broken by Charles Babbage, the inventor of the first analytical calculating machine, although this fact only became known in the 20th century, when a group of scholars examined Babbage's calculations and personal notes [44]. Despite this, the Vigenère cipher had a reputation for being exceptionally resistant to “manual” breaking for a long time afterward. For instance, the well-known writer and mathematician Charles Lutwidge Dodgson (Lewis Carroll), in his article “The Alphabet Cipher”, published in a children's magazine in 1868, called the Vigenère cipher unbreakable. In 1917, the popular-science magazine “Scientific American” also described the Vigenère cipher as unbreakable [13].

Rotor machines. The ideas of Alberti and Bellaso were used in the creation of electromechanical rotor machines in the first half of the 20th century. Some of them remained in use in various countries as late as the 1980s. Most of them used rotors (mechanical wheels) whose relative positions determined the current substitution alphabet used to perform the substitution. The best known of the rotor machines is the German machine from the Second World War, the “Enigma”.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.19. Enigma [www.cryptomuseum.com]

The output pins of one rotor are connected to the input pins of the next rotor, and pressing a key for a symbol of the plaintext message closed an electrical circuit, causing a lamp to light up showing the substitute symbol.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

a) four rotors connected in series

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

b) rotor pins

Fig. 5.20. Enigma's rotor system [www.cryptomuseum.com]

The encrypting action of the “Enigma” is shown for two successive key presses - the current flows through the rotors, is “reflected” by the reflector, and then passes through the rotors again.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.21. Encryption diagram

Note. Grey lines show other possible electrical circuits inside each rotor. The letter A is encrypted differently on successive presses of the same key, first as G, then as C. The signal takes a different path because one of the rotors turns after the previous letter of the plaintext message is pressed.

Shadow ciphers [43]. The main entertainments for Americans in the 1930s were pulp fiction and radio. To promote its books, the publisher Street & Smith sponsored a radio show hosted by the Shadow, a mysterious narrator with a sinister voice who declared at the start of every episode: “Who knows what evil lurks in the hearts of men? The Shadow knows!”. The show's success prompted the publisher to decide to launch a series of books featuring the Shadow as the main character. Walter Gibson, a great enthusiast of magic tricks and puzzles, offered his services. Under the pen name Maxwell Grant he began writing novel after novel, at such a pace that over his lifetime he wrote almost 300 books about the scourge of those with impure intentions. In the story “The Chain of Death”, the superhero used what was called a direction code, although in reality it works more like a cipher than a code.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.22. Substitution and control symbol table

The control symbols in the last row of the table are used to change the encryption/decryption code (i.e., to select the cipher alphabet). The lines inside a control symbol tell the recipient how to hold the sheet of paper in order to decrypt the next symbol of the cryptogram. Symbol 1 means the sheet should be held as usual, with the top and bottom in their normal places. Symbol 2 requires the sheet to be turned 90° to the right in order to decrypt the next symbol. Control symbols can appear before any line of text, as well as in the middle of it.

The example below reveals the superhero's real first and last name.

Simple Substitution Ciphers: The Keyword Cipher, the Masonic Cipher and Others

Fig. 5.23. The Shadow's real name

According to the first control symbol, the sheet should be held normally, without turning it, and after substitution the letters spell “Lamont Cranston” (Lamont Cranston).

See also

  • cryptanalysis
  • encryption
  • [[b6420]]
  • [[b9286]]

See also

created: 2022-02-17
updated: 2026-03-10
895



Was this answer useful?
Choose a quick rating so we can improve the next answer for you.
How satisfied are you?


Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Information security, Cryptographic ciphers"

Terms: Information security, Cryptographic ciphers