Tool to decrypt / encrypt with Félix Marie Delastelle's Trifid cipher having 3 grids of 9 characters.
Delastelle Trifid Cipher  dCode
Tag(s) : PolyAlphabetic Cipher, GRID_CIPHER
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
Delatelle trifid cipher is a polyalphabetic cipher using a threedimensional grid (or 3 grids) and triplets (grid, row, column).
The Delastelle trifid cipher uses three 9character grids (for 27 distinct characters in total) and an integer N (usually 5 or 7).
Example: Encrypt the message SECRET, with N = 5 and grids
Grid 1  Grid 2  Grid 3  




Often, a keyword is used to generate a disordered alphabet with 27 characters (the Latin alphabet accompanied by another symbol like _ replacing any nonalphabetic character)
Step 1: For each character, search for it in grids and note are triplet of 3 corresponding digits (grid, row, column)
Example: S is in grid 3, row 1, column 1, its triplet is 311
Step 2: Write the triplets in columns, in groups of N columns next to each other and read each group in rows.
Example:
S  E  C  R  E    T 
3  1  1  2  1  3  
1  2  1  3  2  1  
1  2  3  3  2  2 
Reading group 1: 31121,12132,12332, group 2: 312
Step 3: Cut out each sequence of digits read in triplet (group of 3 digits) corresponding to [grid, row, column]and note the corresponding letter. These letters constitute the encrypted message.
Example: 311,211,213,212,332,312 corresponds to SJLKZT
Decryption is very similar to encryption, the difference is in step 2.
Example: Decrypt the message SJLKZT, with N = 5 and grids
Grid 1  Grid 2  Grid 3  




Step 1: identical to encryption
Step 2: Take the triplets in groups of N and write them in Nlength rows below each other then read each group in columns.
Example: 311,211,213,212,332,312 is written
3  1  1  2  1    3  1  2 
1  2  1  3  2    
1  2  3  3  3   
Reading group 1: 311,122,113,233,123, group 2: 3,1,2
Step 3: Identical to encryption
Example: 311,122,113,233,123,312 corresponds to the plain message SECRET
The message is theoretically composed of not more than 27 distinct characters.
The N number quickly changes the encrypted message, for better encryption, it is advisable to take a value of N coprime with 3.
Félix Marie Delastelle described this encryption in 1902 in his book Traité Élémentaire de Cryptographie
dCode retains ownership of the "Delastelle Trifid Cipher" source code. Except explicit open source licence (indicated Creative Commons / free), the "Delastelle Trifid Cipher" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Delastelle Trifid Cipher" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Delastelle Trifid Cipher" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.
The copypaste of the page "Delastelle Trifid Cipher" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Delastelle Trifid Cipher on dCode.fr [online website], retrieved on 20241004,