Vigenère Cipher

The Vigenère Cipher is a classical cryptographic method that enhances the security of simple substitution ciphers. It was developed by the French diplomat Blaise de Vigenère in the 16th century.

In the Vigenère Cipher, the key to encryption is a secret word or phrase known only to the sender and recipient. Unlike the Caesar Cipher (a type of substitution cipher with a fixed shift value), the Vigenère Cipher uses a keyword of varying length. Each letter of the keyword corresponds to a specific shift value in the alphabet.

To encrypt a message using the Vigenère Cipher, the sender repeats the keyword as many times as necessary to match the length of the plaintext message. Each letter of the keyword is then aligned with a letter in the plaintext, and the corresponding shift value is applied.

By using different shift values for each letter of the keyword, the Vigenère Cipher creates a more complex encryption pattern that makes it challenging for cryptanalysts to decipher without knowing the keyword.

Decryption of the Vigenère Cipher requires the recipient to possess the correct keyword. By applying the reverse shift for each letter of the keyword, the original message is revealed.

Although the Vigenère Cipher was considered unbreakable for several centuries, it eventually succumbed to frequency analysis and other cryptographic techniques. Nonetheless, it remains a significant historical advancement in cryptography and continues to be a valuable tool for learning cryptographic principles and techniques.

Trifid Cipher

The Trifid Cipher is a cryptographic technique that combines elements of substitution and transposition ciphers to encrypt messages. It was invented in 1901 by Félix Delastelle, a French cryptographer, and is known for its use of three-dimensional representations.

To use the Trifid Cipher, the alphabet is first arranged into a three-dimensional cube, with each letter assigned specific coordinates in the cube. The cube is then flattened into three separate grids, each representing one of the three dimensions.

To encrypt a message, the plaintext is divided into groups of characters, and each character's corresponding coordinates in the Trifid cube are noted. The resulting set of coordinates is then transformed into ciphertext using the Trifid grids.

Decryption of the Trifid Cipher follows the reverse process. The ciphertext coordinates are mapped back to the Trifid cube, and the original letters are obtained.

The Trifid Cipher's strength lies in its complexity, which makes it more resistant to frequency analysis compared to simpler ciphers. Its three-dimensional nature and the combination of substitution and transposition techniques add to its cryptographic robustness.

Despite its relative complexity, the Trifid Cipher is not widely used in modern cryptography due to the availability of more efficient and secure encryption methods. However, it remains an intriguing example of historical cryptographic innovation and serves as a testament to the ingenuity of early cryptographers in developing intricate methods to protect secret messages.

Running Key Cipher

The Running Key Cipher is a method of encryption that uses a keyword or phrase as a key for the encryption process. This cipher is essentially a variant of the Vigenère cipher but relies on a continuous key rather than a repeating one. The technique was developed during the 19th century, with roots traced back to various classical encryption methods, though its precise origins are less documented than other ciphers. It was used primarily for securing messages where a one-time pad or a similar technique was impractical.

The Running Key Cipher works by taking a plaintext message and aligning it with a long, non-repeating key. The key is extended as needed to match the length of the plaintext. Each letter of the plaintext is then shifted according to the corresponding letter of the key. This method offers a significant improvement in security over simple substitution ciphers, as the shifting is based on a variable key rather than a fixed substitution.

Consider the plaintext message "CATENCODE" and the key "ENCRYPTED".

Align the key:

Plaintext:  C A T E N C O D E
Key:        E N C R Y P T E D
  1. Encrypt each letter:
    1. C (3) + E (5) = H (8)
    2. A (1) + N (14) = O (15)
    3. T (20) + C (3) = W (23)
    4. E (5) + R (18) = W (23)
    5. N (14) + Y (25) = M (13)
    6. C (3) + P (16) = S (19)
    7. O (15) + T (20) = I (9)
    8. D (4) + E (5) = I (9)
    9. E (5) + D (4) = I (9)

Resulting Ciphertext:

The plaintext "CATENCODE" can be encrypted to "HOWWMSIII".

Here’s how the Running Key Cipher encryption works for the letters involved:

Plaintext Pair

Key Pair

Shift (Plaintext + Key)

Ciphertext

C

E

(3 + 5) mod 26 = 8

H

A

N

(1 + 14) mod 26 = 15

O

T

C

(20 + 3) mod 26 = 23

W

E

R

(5 + 18) mod 23 = 23

W

N

Y

(14 + 25) mod 26 = 13

M

C

P

(3 + 16) mod 26 = 19

S

O

T

(15 + 20) mod 26 = 9

I

D

E

(4 + 5) mod 26 = 9

I

E

D

(5 + 4) mod 26 = 9

I

This table shows how each letter in the plaintext message interacts with the corresponding letter in the key to produce the final ciphertext. The Running Key Cipher emphasizes the importance of the key in encryption, highlighting how a longer, non-repeating key significantly increases security compared to traditional methods.

Polygraphia

Polygraphia is a historical treatise on cryptography and steganography written by Johannes Trithemius, a German abbot and scholar, in the late 15th century. The word polygraphia is derived from Greek, where poly means many and graphia means writing reflecting the treatise's focus on various methods of secret writing and communication.

In this comprehensive work, Trithemius delves into the study of cryptographic techniques, such as substitution ciphers, transposition ciphers, and other methods of encrypting messages. He also explores steganography, which involves concealing secret information within seemingly ordinary texts or images.

Polygraphia served as one of the earliest significant works on the subject of cryptography and steganography, and it contributed to the development and dissemination of secret writing practices during the Renaissance period.

While some of Trithemius's ideas and methods were groundbreaking for his time, others were deemed impractical or flawed, leading to debates and criticisms. Nevertheless, Polygraphia played a pivotal role in shaping the evolving landscape of cryptography and secret communication, paving the way for more sophisticated and secure encryption techniques that emerged in later centuries.

Polyalphabetic Cipher

The Polyalphabetic Cipher is a type of substitution cipher that enhances the security of traditional ciphers by introducing multiple alphabets or cipher alphabets. In this encryption technique, each letter of the plaintext is substituted with a corresponding letter from one of several different cipher alphabets, based on a secret key or keyword.

To encrypt a message using the Polyalphabetic Cipher, the sender selects a keyword or keyphrase that determines the arrangement of the cipher alphabets. Each letter of the keyword is used to create a distinct cipher alphabet, and these alphabets are then applied cyclically to the plaintext.

During encryption, the same letter in the plaintext may be encrypted differently depending on its position within the keyword and the corresponding cipher alphabet. This variability introduces a higher level of complexity and makes it more challenging for cryptanalysts to decipher the message through frequency analysis.

The Polyalphabetic Cipher gained significant historical prominence with the invention of the Vigenère Cipher, a well-known example of a polyalphabetic cipher. The Vigenère Cipher uses a tabula recta (a table of alphabets) to encode and decode messages, making it an effective and popular encryption method during its time.

While the Polyalphabetic Cipher offers stronger security compared to monoalphabetic ciphers, it is not as robust as modern cryptographic methods. Nonetheless, it remains an essential step in the historical evolution of encryption techniques, paving the way for more advanced and secure encryption systems used today.

Playfair Cipher

The Playfair Cipher is a manual symmetric encryption technique that encrypts pairs of letters (bigrams) instead of single letters. It was invented by Charles Wheatstone in 1854 but became known as the Playfair Cipher after it was promoted by Lord Playfair. This cipher was used extensively during the World War I era for secure military communications, as it provided better security than simple substitution ciphers by addressing frequency analysis vulnerabilities.

The Playfair Cipher uses a 5x5 square grid filled with letters of the alphabet. To fit the 25 letters of the English alphabet into the grid, the letters I and J are usually combined. The plaintext is divided into pairs of letters. If a pair consists of the same letter (like "LL"), an X is inserted between them (making it "LX" in this case). If there's an odd number of letters, an X is added to the end. The pairs are then encrypted based on their positions in the grid.

Encoding "HELLO" with keyword "MONARCHY"

  1. Keyword MONARCHY generates the 5x5 matrix (I/J combined):
  2. Input "HELLO" is prepared as pairs: HE LX LO (X added for repeated L).
  3. Encoding rules applied:
    • Same row → shift right.
    • Same column → shift down.
    • Rectangle → swap corners.
  4. Resulting cipher text: CFSUAV.

Foursquare Cipher

The Foursquare Cipher is a type of transposition cipher that was developed in the early 20th century, with significant contributions attributed to Charles Wheatstone, who first described a similar device in 1854. The cipher is notable for its innovative use of a 5x5 square grid to encrypt letters in a way that increases the complexity of the message, making it more secure than simpler ciphers.

The Foursquare Cipher operates by using two 5x5 grids, each filled with a keyword or phrase. The plaintext is then encrypted using these grids by following a specific set of rules. Each letter in the plaintext is paired with a letter from the other grid, and the position of the letters determines the resulting encrypted letter. This dual-grid approach adds layers of complexity to the encryption process.

This cipher was particularly used during the early 20th century for secure communication, especially in military and diplomatic contexts, due to its relative simplicity and effectiveness compared to other ciphers of the time. The Foursquare Cipher allows for both encryption and decryption by utilizing the same grids, making it a versatile tool for cryptography.

An example of how the Foursquare Cipher works can be illustrated through a simple plaintext message and the resulting encrypted output. Here’s how the encryption could occur using a keyword-based grid.

Let's say we have the following grids:

Grid 1 (filled with a keyword, such as "KEYWORD"):

K

E

Y

W

O

R

D

A

B

C

F

G

H

I/J

L

M

N

P

Q

S

T

U

V

X

Z

Grid 2 (filled with a second keyword, such as "EXAMPLE"):

E

X

A

M

P

L

B

C

D

F

G

H

I/J

K

N

O

Q

R

S

T

U

V

W

Y

Z

For the plaintext "HELLO", the process would involve locating the letters in the grids and applying the Foursquare rules:

  1. H (from Grid 1) and E (from Grid 2) are paired.
  2. The intersection gives the encrypted letter.
  3. This process continues for each letter in the plaintext.

Thus, "HELLO" could be transformed into "CAFGHY" using this encryption method. The Foursquare Cipher provides an elegant solution to encrypt messages while maintaining a degree of security, showcasing the ingenuity of early cryptographic methods.

Enigma Cipher

The Enigma Cipher is one of the most famous cipher machines in history, developed by Arthur Scherbius in Germany in the early 1920s. Initially designed for commercial purposes, it quickly garnered attention from the German military, who adopted it for secure communication. The Enigma was extensively used by Nazi Germany during World War II to encode military communications, as its complex encryption was considered unbreakable at the time.

The Enigma machine relied on a series of rotors, each containing a scrambled alphabet. Every time a letter was typed, the machine would pass an electric current through multiple rotors, producing a different substitution based on the rotors' positions. After each key press, the rotors would shift, creating a polyalphabetic substitution system where each letter in a message could be substituted differently, depending on the rotor configuration at that moment. This resulted in a highly complex encryption that required precise knowledge of the rotor positions to decrypt messages successfully.

To decode the Enigma’s messages, one would need to know the initial settings of the rotors (the "key"), which changed daily. The German military increased the cipher's complexity by adding plugboards, further scrambling the letters before they reached the rotors. This added layer made the Enigma's encryption even more difficult to break.

However, the Enigma Cipher was ultimately cracked by Allied cryptographers, most notably Alan Turing and his team at Bletchley Park in the 1940s. By developing an electromechanical device called the Bombe, Turing’s team was able to determine the settings of the Enigma machine’s rotors, effectively breaking the cipher. This breakthrough was instrumental in shortening the war, as the Allies gained access to critical German military communications.

Here’s a simplified table to show the type of substitution that could occur within a single Enigma machine encryption step (note that in reality, the settings changed with each letter, leading to varying substitutions throughout the message):

Plaintext

Rotor Setting (Before)

Substitution (After Rotors)

Rotor Setting (After)

Encrypted Letter

A

Position 1

G

Position 2

G

T

Position 2

Q

Position 3

Q

T

Position 3

Z

Position 4

Z

A

Position 4

H

Position 5

H

C

Position 5

M

Position 6

M

Each key press would change the rotor settings, resulting in different substitutions for the same letter in the plaintext. This constant shifting is what made the Enigma Cipher so challenging to decipher without knowing the exact initial settings and configurations of the rotors. The Enigma machine's legacy endures as a pivotal development in cryptography and as a key component in the history of World War II.

Digraph Cipher

A Digraph Cipher is a cryptographic technique that operates on pairs of letters (digraphs) rather than individual letters. It is a substitution cipher where each digraph in the plaintext is replaced by a corresponding digraph in the ciphertext according to a predefined rule or key.

Here's a general overview of how a Digraph Cipher works:

  • Key Generation: The sender and receiver agree on a specific encryption rule or key that determines the mapping between digraphs in the plaintext and the corresponding digraphs in the ciphertext.
  • Splitting into Digraphs: The plaintext is divided into pairs of letters (digraphs). If the plaintext contains an odd number of letters, a padding character (such as X) may be added at the end to form a complete digraph.
  • Encryption: Each digraph in the plaintext is replaced by the corresponding digraph in the ciphertext according to the encryption rule or key.
  • Decryption: The receiver uses the same encryption rule or key to decipher the ciphertext. Each digraph in the ciphertext is replaced by the corresponding digraph in the plaintext.

The encryption and decryption rules in a Digraph Cipher can vary depending on the specific algorithm or key chosen. Some common approaches include:

  • Digraph Substitution: Each digraph is replaced with a different digraph based on a substitution table or matrix. For example, the digraph AB in the plaintext might be replaced by the digraph XY in the ciphertext.
  • Digraph Transposition: The order of the digraphs in the plaintext is rearranged according to a specific transposition rule or permutation. This rearrangement can be based on the positions of the letters within the digraphs or other predetermined patterns.
  • Digraph Combination: The encryption process may involve a combination of substitution and transposition techniques, where digraphs are both substituted and rearranged.

The security of a Digraph Cipher depends on the complexity and randomness of the encryption rule or key. It is important to use a sufficiently large set of possible digraph mappings to ensure resistance against cryptanalysis techniques such as frequency analysis.

Digraph Ciphers have been used historically as a way to enhance the security of simple substitution ciphers by introducing an additional layer of complexity. However, they are generally considered relatively weak compared to more modern and sophisticated encryption methods.

It's worth noting that while the concept of Digraph Ciphers provides an interesting perspective on encryption, they are not commonly used in modern cryptography. Instead, more advanced algorithms, such as symmetric key ciphers (e.g., AES) or public-key ciphers (e.g., RSA), are employed to ensure stronger security.

A Digraph Cipher is a type of substitution cipher that encrypts pairs of letters (digraphs) from the plaintext, rather than single letters as in simpler substitution ciphers. The Playfair cipher is one well-known example of a digraph cipher.

Below is an example of a Playfair Cipher table (which is a type of Digraph Cipher) using the keyword "CIPHER." The table is constructed by placing the keyword at the start and filling the rest of the 5x5 grid with the remaining letters of the alphabet (I and J are typically treated as the same letter in Playfair).

Step 1: Construct the Playfair Table

Keyword: CIPHER

  1. Remove duplicate letters from the keyword.
    • CIPHER → C, I, P, H, E, R
  2. Fill the table with the keyword first, followed by the remaining letters of the alphabet (excluding J, or combining I/J):

Playfair Cipher Table Example:

C

I

P

H

E

R

A

B

D

F

G

K

L

M

N

O

Q

S

T

U

V

W

X

Y

Z


Step 2: Encrypting with the Digraph Cipher

To encrypt with the Playfair cipher, you follow these basic rules:

  1. Pair the letters of the plaintext into digraphs (groups of 2). If a digraph contains the same letter twice (e.g., "LL"), insert an "X" between them.
  2. Locate the letters of each digraph in the table.
    • If both letters appear on the same row, replace them with the letters immediately to their right (wrapping around if needed).
    • If both letters appear in the same column, replace them with the letters immediately below them (wrapping around if needed).
    • If the letters form a rectangle, replace them with the letters at the other corners of the rectangle.

Example

Suppose we want to encrypt the word "HELLO":

  1. Convert to digraphs: "HE LL O"
    • "LL" becomes "LX" (to break the repeated letters)
    • So, now we have the pairs: "HE", "LX", "LO"
  2. Use the Playfair table to find and replace each digraph:
  • "HE": H and E are in the same row. The letter to the right of H is E, and the letter to the right of E is C. So, "HE" becomes "EC".
  • "LX": L and X form a rectangle. Replace L with X and X with L, so "LX" becomes "PX".
  • "LO": L and O form a rectangle. Replace L with G and O with R, so "LO" becomes "GR".
  1. The final encrypted message is: "EC PX GR"

This is how a Digraph Cipher using the Playfair cipher works with a simple table and a keyword.

Chaocipher

The Chaocipher is a cipher system invented by John Francis Byrne in 1918. Byrne, an American author and cryptologist, created this cipher with the hope of presenting a complex and supposedly "unbreakable" encryption system that could be used in the military and for diplomatic purposes. However, unlike many other historical ciphers, the Chaocipher remained a mystery for a long time, as Byrne kept the details of its inner workings a secret, even after presenting it to various cryptographic experts of his time. He demonstrated the cipher's security by sending encrypted messages to prominent cryptographers, challenging them to decode it without revealing the method.

For decades, the Chaocipher intrigued cryptologists because Byrne never disclosed the mechanism, and he even included it as an unsolved challenge in his autobiography. The inner mechanics of the cipher were finally revealed only in 2010, almost a century later, when Byrne's family donated his notes to the National Cryptologic Museum.

The Chaocipher works using two rotating alphabets, which change positions after encrypting each character, making it a polyalphabetic substitution cipher. The two alphabets interact in a way that makes each letter dependent on all previous letters in the message, resulting in a complex, interwoven encryption. Unlike other polyalphabetic ciphers where a keyword guides encryption, the Chaocipher relies on systematic rotations of the alphabets, which vary with every letter in the plaintext, creating a different substitution for each character.

Here’s a simplified example to illustrate the general process of the Chaocipher's mechanism. Note that a complete example is difficult without knowing the exact rotation rules and positions, as they are unique to the Chaocipher’s design.

Suppose we want to encrypt the word HELLO with the Chaocipher. We start with two wheels of alphabets:

  1. Left Wheel (Plaintext Alphabet)
  2. Right Wheel (Ciphertext Alphabet)

Each letter is encrypted by matching it from the Left Wheel to the corresponding letter in the Right Wheel. After each letter, both wheels are rotated in a specific way that changes the subsequent mappings, making each letter encrypted differently based on the evolving positions of the alphabets.

For example:

Plaintext

Left Wheel Position (Before)

Right Wheel Position (Before)

Ciphertext

New Left Position

New Right Position

H

ABCDEFGHIJKLMNOPQRSTUVWXYZ

ZYXWVUTSRQPONMLKJIHGFEDCBA

S

Rotated

Rotated

E

[Adjusted Alphabet]

[Adjusted Alphabet]

P

Rotated

Rotated

L

[Adjusted Alphabet]

[Adjusted Alphabet]

V

Rotated

Rotated

L

[Adjusted Alphabet]

[Adjusted Alphabet]

D

Rotated

Rotated

O

[Adjusted Alphabet]

[Adjusted Alphabet]

W

Rotated

Rotated

Each step would result in new configurations for the wheels, which makes reconstructing the encryption or decryption without knowing the rotations virtually impossible. This complexity was the essence of the Chaocipher’s mystery and its reputed security.