The Two-Square Cipher is a variant of the Four-Square cipher, intended to be easier to use (and as a result less secure) than the Four-Square cipher, though still more secure than the single-square Playfair cipher.

As with the Playfair and Four-Square cipher, the Two-Square cipher uses two square matrices of a 25 letter alphabet (dropping the letter Q) and then rearranging the letters to form two unique keywords. Let’s say we want to use the keywords “password” and “apple” (removing duplicate letters) to build our two 5×5 squares. They can be aligned either horizontally or vertically, in this example we’ll use vertical.

`P A S W O`

R D B C E

F G H I J

L M N S T

U V X Y Z

A P L E B

C D F G H

I J K M N

O R S T U

V W X Y Z

We now have to split our plaintext, the message we want to encrypt, into **digraphs**, pairs of two letters. With a plaintext message of “sell your stocks now”, we’d end up with “se ll yo ur st oc ks no wz”, appending a ‘z’ to make an even number of letters. We now have all we need to use the Two-Square cipher.

Performing encryption is similar to the other square ciphers, we form a rectangle between the two squares, using the first letter of each digraph as the location in the first square, and the second letter of the digraph as the location in the second square. Encrypting our first digraph, ‘SE’, would look like this.

`P A S W O`

R D B C E

F G H I J

L M N S T

U V X Y Z

A P L E B

C D F G H

I J K M N

O R S T U

V W X Y Z

In this case, S would become L, and E would become W – they take the letter of the opposite square’s corner of the rectangle that the two letters form. Our next digraph, ‘LL’, would encrypt to ‘AN’, ‘YO’ to ‘TU’, and so on.

However, something unique to the Two-Square cipher happens when we get to the digraph ‘ST’ in this example. S in the first table and T in the second are in the same column. They don’t form a rectangle – they form a line.

`P A S W O`

R D B C E

F G H I J

L M N S T

U V X Y Z

A P L E B

C D F G H

I J K M N

O R S T U

V W X Y Z

In this case, with the two-square cipher, ‘ST’ would encrypt to ‘ST’ – itself. The ability for digraphs (and therefore sections of messages) to encrypt into themselves is precisely why the Two-Square cipher is not as strong as the more complex Four-Square cipher.