Search for a tool
Two-square Cipher

Tool to decript/encrypt Two-square automatically. Two-square cipher uses a playfair-like process to encrypt (it is also called double playfair), except that it uses two keys or 5x5 square-grids

Results

Two-square Cipher -

Tag(s) : Cryptography,Polygrammic Cipher

dCode and you

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!


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.

This page is using the new English version of dCode, please make comments !

Two-square Cipher

Sponsored ads

This script has been updated, please report any problems.

Two-Square Decoder






Also on dCode: PlayFair Cipher

Two-Square Encoder






Also on dCode: PlayFair Cipher

Tool to decript/encrypt Two-square automatically. Two-square cipher uses a playfair-like process to encrypt (it is also called double playfair), except that it uses two keys or 5x5 square-grids

Answers to Questions

How to encrypt using Two-Square cipher?

Encryption uses two squared grid placed side to side (horizontal variant), or one above the other (vertical variant), sometimes generated with a key word (deranged alphabethref)

One wants to crypt DCODE

Let the two grids (horizontal) be generated with the words KEY and WORD respectively

\12345
1KEYAB
2CDFGH
3ILMNO
4PQRST
5UVWXZ
\12345
1WORDA
2BCEFG
3HIKLM
4NPQST
5UVXYZ

The first step consists in splitting the plain text into bigrams (couples of two letters).

DC, OD, EZ (one random letter from the grid is added if necessary)

For each bigram, one has to 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, one has to 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. IE: one has to locate the two original letters and find the two other letters that create a rectangle. Ciphered letters are written beginning with the one on the same line of the first plain letter in grid 2 and then grid 1.

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

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)

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)

Ciphered text is then CDLBAV

How to decrypt Two-Square cipher?

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

Let the grids be in this horizontal position

\12345
1KEYAB
2CDFGH
3ILMNO
4PQRST
5UVWXZ
\12345
1WORDA
2BCEFG
3HIKLM
4NPQST
5UVXYZ

Let the cipher text be CDLBAV split in CD, LB, AV

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

If the two letters are on the same line, then 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, one starts with the letter on the same line of the first letter of the bigram, so grid 1.

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

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)

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)

The original plain text is DCODEZ.

How to recognize Two-Square ciphered text?

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

How to decipher Two-Square without the two squares?

One can crack Two-Square by a frequency analysishref of bigrams if the text is long enough.

What are the variants of the Two-Square cipher?

Excepting variations due to creating a deranged alphabethref 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

- the order of the grid (switch grid 1 and 2)

- the order of bigram letters notation

When Two-Square have been invented?

?

Ask a new question

Source code

dCode retains ownership of the source code of the script Two-square Cipher. Except explicit open source licence (free / freeware), any algorithm, applet, software (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any snippet or function (convert, solve, decrypt, encrypt, decipher, cipher, decode, code, translate) written in PHP (or Java, C#, Python, Javascript, etc.) which dCode owns rights can be transferred after sales quote. So if you need to download the Two-square Cipher script for offline use, for you, your company or association, see you on contact page !

Questions / Comments


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.


Source : http://www.dcode.fr/two-square-cipher
© 2016 dCode — The ultimate 'toolkit' website to solve every problem. dCode