Tool to decrypt / encrypt with 4 squares cipher. The four-square encryption uses 4 5-by-5 grids combined 2 to 2 to extract letters.
Four Square 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!
The 4-squares encryption is made, as its name suggests, with four square grids (possibly generated from a keyword) themselves positioned in a square:
Grid 1 | Grid 2 |
Grid 3 | Grid 4 |
Example: 4 grids formed from the first names JOHN, GEORGE, PAUL and RINGO (the letter Z is omitted)
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
The first step is to split the plain message into pairs of two letters (completed with a neutral letter if necessary).
Example: The plain message BEATLES is decomposed into 'BE, AT, LE, SX'
For each pair (bigram), locate the first letter in grid 1 and the second letter in grid 4. Intersect the rows and columns of the letters found in the two adjacent grids and write down these 2 new letters.
Example: Bigramme BE: B is positioned (row 2, column 1) in grid 1 E is positioned (row 2, column 5) in grid 4
The extension of their rows and Columns in grids 2 and 3 leads to 2 intersections: H, positioned (row 2, column 5) in grid 2 and C, positioned (row 2, column 1) in grid 3
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
The encrypted text consists of the letters found at the intersections: first the letter in the grid 2 and then the letter in the grid 3.
Example: The final encrypted message is HCASMFSX
4 Squares decryption is almost identical to the encryption. The difference is that it is necessary to position the letters of the encrypted bigram in grids 2 and 3, then read the light letters in grids 1 and 4.
Example: (See above) the bigramme HC is positioned in grids 2 and 3 and deciphers BE in grids 1 and 4.
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Four Squares is a polygrammic encryption, so it is advisable to perform an analysis of the bigrams if the text is long enough.
Also, the presence of 4 keywords that can generate the grids is a clue.
Grids with 25 letters, there is normally at least one missing letter from Latin alphabet in the encrypted text.
The company foursquare has a name that can be linked with this cipher.
dCode retains ownership of the "Four Square Cipher" source code. Any algorithm for the "Four Square Cipher" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Four Square Cipher" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Four Square Cipher" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Four Square Cipher" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source.
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Four Square Cipher on dCode.fr [online website], retrieved on 2025-04-16,