Trifid Cipher Encryption and Decryption

Plaintext
Ciphertext
123
1ABC
2DEF
3GHI
123
1JKL
2MNO
3PQR
123
1STU
2VWX
3YZ_

What is the Trifid Cipher?

The Trifid Cipher is a positional substitution cipher developed by French cryptographer Felix Delastelle in 1901. Unlike traditional substitution ciphers, which rely solely on the order of the alphabet, the Trifid Cipher uses three dimensions to assign letter positions. It divides the alphabet into three groups and converts plaintext letters into three-dimensional coordinates (layer, row, column) for encryption.

In the encryption process, the Trifid Cipher maps each letter of the plaintext to a three-dimensional coordinate system. Afterward, the coordinates are rearranged according to certain rules, generating the ciphertext. The complexity of combining three-dimensional coordinates provides a higher level of security than traditional substitution ciphers.

How Does the Trifid Cipher Encrypt?

The encryption process involves the following steps:

  1. Prepare the Plaintext: Remove spaces, punctuation, and any non-alphabet characters from the plaintext.
  2. Define the Trifid Cipher Alphabet: The Trifid Cipher uses a standard alphabet, assigning letters to a three-dimensional coordinate system based on layers, rows, and columns.
  3. Convert the Plaintext Letters to Three-Dimensional Coordinates: Each letter's position is represented by its layer, row, and column.
  4. Organize the Coordinates into a Table: Each letter's three-dimensional coordinates are organized vertically in a table, with the first row showing the layer, the second row showing the row, and the third row showing the column.
  5. Group by Size: The organized coordinates are grouped by the specified group size, sorted by columns.
  6. Rearrange Coordinates by Group: Within each group, the coordinates are recombined horizontally, with three coordinates per group, resulting in new coordinates.
  7. Generate the Ciphertext: Using the new coordinates, find the corresponding letters in the three-dimensional grid and substitute them for the ciphertext.

Example

Suppose the plaintext is "HELLO WORLD", the alphabet is made up of 26 English letters plus a special character ("ABCDEFGHIJKLMNOPQRSTUVWXYZ_"), and the group size is 4.

1. Generate the Three-Dimensional Coordinate System:

123
1ABC
2DEF
3GHI
123
1JKL
2MNO
3PQR
123
1STU
2VWX
3YZ_

2. Convert the Letters to Three-Dimensional Coordinates:

3. Organize the Coordinates into a Table:

PlaintextHELLOWORLD
Layer1122232221
Row3211222312
Column2233323331

4. Group by Size:

HELL
1122
3211
2233
OWOR
2322
2223
3233
LD
21
12
31

5. Rearrange Coordinates by Group:

6. Convert Coordinates to Ciphertext Letters:

Therefore, the encryption result for "HELLO WORLD" is: "BQBRQNRRJP".

How Does the Trifid Cipher Decrypt?

The decryption process is the reverse of the encryption process. The first three steps are the same as the encryption process, but from step 4 onwards, there are key differences:

Example

Suppose we need to decrypt the ciphertext "BQBRQNRRJP" with a group size of 4, using the same alphabet as the encryption process.

1. Obtain the Three-Dimensional Coordinates for the Ciphertext Characters:

2. Organize the Coordinates into a Table by Group Size:

1122
3211
2233
2322
2223
3233
21
12
31

3. Rearrange Coordinates by Columns:

4. Decrypt to Plaintext:

Therefore, the decryption result for "BQBRQNRRJP" is: "HELLOWORLD".

Share This Page