1. Overview

Cryptography has been an important tool for securing information for centuries. One interesting method in this field is the polyalphabetic cipher. This cipher uses multiple substitutions to encrypt data, making it harder to crack.

In this tutorial, we discuss the polyalphabetic cipher and its subtype, the Vigenère cipher.

2. Historical Background

The concept of polyalphabetic ciphers dates back to the Renaissance. Trithemius published the first work on the polyalphabetic cipher, “Recta Tabula,” in “Libri Polygraphiae VI” in 1518. However, Leon Battista Alberti had conceived a polyalphabetic system decades earlier, around 1470. Unfortunately, his treatise “De Cifris,” which included an encrypting disk, remained a secret for nearly a century, seeing the light of day in 1568.

The second notable work after Trithemius was by Giovan Battista Bellaso, an Italian cryptologist. He often gets credit for creating the first polyalphabetic cipher in the 15th century. However, his work was incorrectly attributed to Blaise de Vigenère, so this cipher was named after him.

The Vigenère cipher is far stronger than the Caesar cipher. For nearly 300 years, it couldn’t be broken. However, in the mid-nineteenth century, Charles Babbage and Friedrich Kasiski independently found ways to break it.

3. Basics of Polyalphabetic Ciphers

Polyalphabetic ciphers use multiple substitutions of letters, while monoalphabetic ciphers use a single substitution alphabet.

Therefore**, the substitution letter changes with each plaintext letter in polyalphabetic ciphers**. This method significantly complicates the frequency analysis technique.

For example, in a monoalphabetic cipher, the letter A might always be replaced with D. In contrast, in a polyalphabetic cipher, A could be D in one place, G in another, and Z in another. The substitutions depend on the cipher’s key. Thus, this cipher adds layers of complexity and security.

4. Vigenère Cipher

The Vigenère cipher is a typical example of a polyalphabetic cipher. There are two ways to encrypt messages with it:

  1. Using the modulus operator
  2. Using Vigenère table

4.1. Using Modulus Operator

With the modulus operator, we follow these steps:

  1. pick a secret word (the key) to scramble our message
  2. each letter in the key and message becomes a number (for example, A = 0, B = 1, and so on)
  3. once we run out of letters in the key, we use it again from the start
  4. take the mod 26 of the sum of each numerical equivalent of the key and message
  5. convert the result back to the letters equivalent

Let the message be WAIT FOR DAWN and the key SKY. First, we find the numbers corresponding to the letters in the message:

Message                W    A    I    T    F    O    R    D    A    W    N
Transformed Message    22    0    8    19    5    14    17    3    0    22    13

Similarly, the numerical equivalent for our key is 18, 10, 24.

Moving on, we repeat the keyword numbers to match the length of the plaintext:

Message                 W    A    I    T    F    O    R    D    A    W    N
Transformed Message     22    0    8    19    5    14    17    3    0    22    13
Transformed Key         18    10    24    18    10    24    18    10    24    18    10

Next, we add the numbers column-wise and calculate the modulus 26 of the results:

Message              W    A    I    T    F    O    R    D    A    W    N
Transformed Message    22    0    8    19    5    14    17    3    0    22    13
Transformed Key            18    10    24    18    10    24    18    10    24    18    10
Modulus                 14    10    6    11    15    12    9    13    24    14    23

Finally, we convert the third row to its corresponding letters, obtaining OKGLPMJNYOX as the ciphertext.

The Vigenère cipher can start with A=1 and B=2 instead of A=0 and B=1, altering the numerical values assigned to each letter but preserving the encryption and decryption principles.

4.2. Using the Vigenère Table

The Vigenère table contains the English alphabet arranged in 26 rows, where each row is shifted cyclically to the left compared to the previous one:

|--------------------------------------------------PLAINTEXT-------------------------------------------------------| | A | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |      - |-----------------------------------------------------------------------------------------------------------|      - | A | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |      - | B | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A |      - | C | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B |      - | D | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C |      - | E | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D |      - | F | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E |      - | G | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F |      - | H | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G |      - | I | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H |      - | J | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I |      K | K | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J |      E | L | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K |      Y | M | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L |      W | N | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M |      O | O | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N |      R | P | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O |      D | Q | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P |      - | R | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q |      - | S | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R |      - | T | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S |      - | U | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T |      - | V | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U |      - | W | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V |      - | X | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W |      - | Y | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X |      - | Z | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y |      -
In the Vigenère table, we use the plaintext alphabet as a row index and the keyword alphabet as a column index.

At first, we write the message and the key:

Message  W     A     I     T     F     O     R     D     A     W    N
Key     S       K     Y     S     K     Y     S     K     Y     S    K

Then, we take the letter W from the plaintext and the key letter S corresponding to the plaintext letter W. Using S as the column index and W as the row index, we get the letter O as the first letter of the ciphertext.

Continuing this way, we get OKGLPMJNYOX as the encrypted message. So, both methods return the same ciphertext.

5. Strengths and Weaknesses

Polyalphabetic ciphers have many advantages over monoalphabetic ones. They provide greater security by using multiple substitution letters, making it challenging for attackers to break the cipher without knowing the keyword.

For example, the one-time pad polyalphabetic cipher, when used correctly with a truly random key that is as long as the message itself, is demonstrably unbreakable.

However, not all polyalphabetic ciphers are unbreakable. They can still succumb to cryptanalysis techniques. For example, the Vigenere cipher can be broken using the Kasiski test and frequency analysis of repeated sequences.

The strength of a polyalphabetic cipher largely depends on the length and complexity of the keyword. Short or simple keywords result in easier-to-break ciphertexts**.**

6. Modern Applications

Classical polyalphabetic ciphers are not used in modern cryptography. However, they’ve influenced premodern and modern encryption methods.

For instance, using multiple keys and shifting letters are foundational principles of modern cryptography algorithms. The Advanced Encryption Standard (AES) and other symmetric-key algorithms use complex key schedules. They obtain multiple subkeys from a primary key. These methods add to security by introducing additional layers of complexity, making unauthorized decryption very difficult.

7. Conclusion

In this article, we learned about the polyalphabetic cipher and its historical background. Then, we looked at the Vigenère cipher, a popular form of the polyalphabetic cipher.

Overall, polyalphabetic ciphers enhance security using multiple substitution alphabets, which makes them more complex and more challenging to crack than monoalphabetic ciphers.