dCode is free and its tools are a valuable help in games, puzzles and problems to solve every day!You have a problem, an idea for a project, a specific need and dCode can not (yet) help you? You need custom development? Contact-me!

Message for dCode's author:

Team dCode read all messages and answer them if you leave an email (not published). It is thanks to you that dCode has the best Two-square Cipher tool. Thank you.

For each bigram, find the first letter in the first grid and the second letter in the second grid and apply the following rules:

- if the letters are on the same row (line) of the table, switch them. (in the vertical version, apply with columns rather than lines)

- else, replace them by the letters one the same lines but on the opposite corner of an imaginary rectangle, with the two first letters as opposite vertices. In practice, locate the two original letters and find the two other letters that create an imaginary rectangle. Encrypted letters are written beginning with the one on the same line of the first plain letter in grid 2 and then grid 1.

Example: D (grid 1) and C (grid 2) are on the same line, switch them: CD

Example: O (grid 1, line 3, column 5) and D (grid 2, line 1, column 4) are not on the same line, opposite corners are L (grid 2, line 3, column 4) and B (grid 1, line 1, column 5)

Example: E (grid 1, line 1, column 2) and Z (grid 2, line 5, column 5) are not on the same line, opposite corners are A (grid 2, line 1, column 5) and V (grid 1, line 5, column 2)

Example: Final encrypted text is then CDLBAV

How to decrypt Two-Square cipher?

Two-Square cipher Decryption requires two grids generated with two keys. The cipher text is split into bigrams (couples of 2 letters).

Example: The cipher text is CDLBAV (split in CD, LB, AV) and the grids are in horizontal position

\

1

2

3

4

5

1

K

E

Y

A

B

2

C

D

F

G

H

3

I

L

M

N

O

4

P

Q

R

S

T

5

U

V

W

X

Z

\

1

2

3

4

5

1

W

O

R

D

A

2

B

C

E

F

G

3

H

I

K

L

M

4

N

P

Q

S

T

5

U

V

X

Y

Z

For each bigram, locate the first letter in grid 2 and the second letter in grid 1.

If the two letters are on the same line, switch them, (in the vertical version, apply with columns rather than lines)

Else, find the 2 original letters by locating the two letters that completes the imaginary rectangle (see encryption). As for the encryption process, start with the letter on the same line of the first letter of the bigram, so grid 1.

Example: C (grid 2) and D (grid 1) are on the same line, switch them: DC

Example: L (grid 2, line 3, column 4) and B (grid 1, line 1, column 5) are not on the same line, opposite corners are O (grid 1, line 3, column 5) and D (grid 2, line 1, column 4)

Example: A (grid 2, line 1, column 5) and V (grid 1, line 5, column 2) are not on the same line, opposite corners are E (grid 1, line 1, column 2) and Z (grid 2, line 5, column 5)

Example: The original plain text is DCODEZ.

How to recognize Two-Square ciphertext?

The ciphered message needs 2 keys, and had generally a maximum of 25 distinct characters.

How to decipher Two-Square without the two squares?

What are the variants of the Two-Square cipher?

Excepting variations due to creating a deranged alphabet out of the keys, it is possible to modify :

- the position of the grids, for example, by setting them vertically rather than horizontally. In this case, encryption and decryption processes should take into account bigram letters on the same column rather than on the same line