Search for a tool
Four Square Cipher

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.

Results

Four Square Cipher -

Tag(s) : Polygrammic Cipher

Share dCode and you

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!

Team dCode likes feedback and relevant comments; to get an answer give an email (not published). It is thanks to you that dCode has the best Four Square Cipher tool. Thank you.

# Four Square Cipher

## Four Squares Encoder

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.

### How to encrypt using Four Squares cipher?

The 4-squares encryption is made, as its name suggests, with four square grids (possibly generated from a keyword) 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)

1 2 3 4 5 \ J O H N A B C D E F G I K L M P Q R S T U V W X Y
1 2 3 4 5 \ G E O R A B C D F H I J K L M N P Q S T U V W X Y
1 2 3 4 5 \ P A U L B C D E F G H I J K M N O Q R S T V W X Y
1 2 3 4 5 \ R I N G O A B C D E F H J K L M P Q S T U V W X Y

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

1 2 3 4 5 \ J O H N A B → → → → ↓ I K L M ↓ Q R S T ↓ V W X Y
1 2 3 4 5 \ G E O R A → → → → H I J K L ↑ N P Q S ↑ U V W X ↑
1 2 3 4 5 \ ↓ A U L B C ← ← ← ← H I J K M N O Q R S T V W X Y
1 2 3 4 5 \ R I N G ↑ ← ← ← ← E F H J K L M P Q S T U V W X Y

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

### How to decrypt Four Squares cipher?

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.

1 2 3 4 5 \ J O H N A B ← ← ← ← ↑ I K L M ↑ Q R S T ↑ V W X Y
1 2 3 4 5 \ G E O R A ← ← ← ← H I J K L ↓ N P Q S ↓ U V W X ↓
1 2 3 4 5 \ ↑ A U L B C → → → → H I J K M N O Q R S T V W X Y
1 2 3 4 5 \ R I N G ↓ → → → → E F H J K L M P Q S T U V W X Y

The message HCASMFSX is decrypted BEATLESX

### How to recognize a 4 Squares ciphertext?

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.

### What are the variants of the 4-Squares cipher?

Variation 1: reverse the order of the bigram obtained. Rather than taking the encrypted letters in the grid 2 then the grid 3, it is possible to reverse this bigram and take the grid 3 then the grid 2.

Option 2: Switch the position of grids 1, 2, 3 and 4.

## Source code

dCode retains ownership of the source code of the script Four Square 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 released for free. To download the online Four Square Cipher script for offline use on PC, iPhone or Android, ask for price quote on contact page !