Tool to decrypt / encode with 3 squares cipher. Threesquare encryption uses three 5 by 5 grids to combine to extract letters with a bit randomness.
Three Squares Cipher  dCode
Tag(s) : Polygrammic 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!
Sponsored ads
Tool to decrypt / encode with 3 squares cipher. Threesquare encryption uses three 5 by 5 grids to combine to extract letters with a bit randomness.
3square encryption is done with three grids (possibly generated from a keyword)
Example: Encrypt MESSAGE with the keys ONE, TWO, THREE' corresponding to the grids
(2)
 


Split the plain message into bigrams (pairs of two letters L1 and L2). Find L1 in grid 1 and L2 in grid 2. Then note the intersection in grid 3 of the line of L1 in grid 1 with the column of L2 in the grid 2.
Example: For the bigram ME, M is in position (line 3, column 5) in grid 1, and E is in position (line 2, column 3) in the grid 2. The intersection in grid 3 is the letter K (line 3, column 3).
Each bigram of the plain text is associated with 3 new letters: a letter taken randomly in the same column as the letter in the grid 1, the letter intersection of the grid 3 and a letter taken randomly in the same line as the letter of the grid 2. These 3 letters (a trigram) represent the coded text for the bigram.
Example: Take T: a random letter in the column 5 (BHMTY) of the grid 1
Take K: the intersection letter of the grid 3 previously found
Take ' D ': a random letter in the line' 2 ( CDEFG ') of the grid' 2 '
The corresponding encrypted trigram is' TKD'.
The final encrypted message is TKDGNVSAFRAV.
Decryption by three squares is done with three grids.
Example: Decrypt UDBJDC with the keys ONE, TWO, THREE' corresponding to the grids
(2)
 


Split the message into trigrams (triplets of three letters L1, L2 and L3) and find L1 in the grid 1, L2 in the grid 3 and L3 in the grid 2.
Example: The first trigram is UDB, U is in position (line 5, column 1) in grid 1, D is in position (line 2, column 3) in grid 3, and B is in position (line 1, column 5) in grid 2.
Find the 2 plain letters:
Plain letter 1: intersection of the line of the letter L2 in the grid 3 with the column of the letter L1 in the grid 1
Plain letter 2 : intersection of the letter L2 column in grid 3 with the line of the letter L3 in grid 2.
Example: The first plain letter is C, intersection of line 2 of D in grid 3 with column 1 of U in grid 1.
The second plain letter is' O ', intersection of column' 3 of D 'in grid' 3 'with line' 1 of B 'in grid' 2 '.
Finally the complete plain message is' CODE'.
The text is theoretically composed of maximum 25 distinct characters.
The final ciphertext is longer than the original of 33%.
The frequency analysis and the coincidence index is similar to an almost random text.
There are several ways to encrypt and note the letters:
The first letter of the bigram is searched in grid 1 and the second letter in grid 2 (encryption 12) but it is possible to invert (encryption 21)
The trigram is then generally noted as:
 a letter taken randomly in the same column as the letter in the grid 1
 the letter of the grid 3
 a letter taken randomly in the same line as the letter of the grid 2
This encryption is said (132). It is of course possible to encrypt with a different order.
dCode retains ownership of the source code of the script Three Squares Cipher online. Except explicit open source licence (indicated Creative Commons / free), any algorithm, applet, snippet, software (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any function (convert, solve, decrypt, encrypt, decipher, cipher, decode, code, translate) written in any informatic langauge (PHP, Java, C#, Python, Javascript, Matlab, etc.) which dCode owns rights will not be given for free. To download the online Three Squares Cipher script for offline use on PC, iPhone or Android, ask for price quote on contact page !