The Two-square cipher, also called double Playfair, is a manual
symmetric
Symmetry (from grc, συμμετρία "agreement in dimensions, due proportion, arrangement") in everyday language refers to a sense of harmonious and beautiful proportion and balance. In mathematics, "symmetry" has a more precise definit ...
encryption
In cryptography, encryption is the process of encoding information. This process converts the original representation of the information, known as plaintext, into an alternative form known as ciphertext. Ideally, only authorized parties can dec ...
technique.
It was developed to ease the cumbersome nature of the large encryption/decryption matrix used in the
four-square cipher
The four-square cipher is a manual symmetric encryption technique. It was invented by the French cryptographer Felix Delastelle.
The technique encrypts pairs of letters (''digraphs''), and thus falls into a category of ciphers known as polygrap ...
while still being slightly stronger than the single-square
Playfair cipher
The Playfair cipher or Playfair square or Wheatstone–Playfair cipher is a manual symmetric encryption technique and was the first literal digram substitution cipher. The scheme was invented in 1854 by Charles Wheatstone, but bears the name o ...
.
The technique encrypts pairs of letters (''digraphs''), and thus falls into a category of ciphers known as
polygraphic substitution
Polygraphic substitution is a cipher in which a uniform substitution is performed on blocks of letters. When the length of the block is specifically known, more precise terms are used: for instance, a cipher in which pairs of letters are substitu ...
ciphers. This adds significant strength to the encryption when compared with
monographic substitution cipher
A monograph is a specialist work of writing (in contrast to reference works) or exhibition on a single subject or an aspect of a subject, often by a single author or artist, and usually on a scholarly subject.
In library cataloging, ''monograp ...
s, which operate on single characters. The use of digraphs makes the two-square technique less susceptible to
frequency analysis
In cryptanalysis, frequency analysis (also known as counting letters) is the study of the frequency of letters or groups of letters in a ciphertext. The method is used as an aid to breaking classical ciphers.
Frequency analysis is based on ...
attacks, as the analysis must be done on 676 possible digraphs rather than just 26 for monographic substitution. The frequency analysis of digraphs is possible, but considerably more difficult, and it generally requires a much larger ciphertext in order to be useful.
History
Félix Delastelle Félix-Marie Delastelle (2 January 1840 – 2 April 1902) was a French cryptographer, best known for inventing the bifid cipher, first presented in the ''Revue du Génie civil'' in 1895 under the name of "cryptographie nouvelle". This cipher combin ...
described the cipher in his 1901 book ''Traité élémentaire de cryptographie'' under the name ''damiers bigrammatiques réduits'' (reduced digraphic checkerboard), with both horizontal and vertical types.
The ''two-alphabet checkerboard'' was described by
William F. Friedman in his book ''Advanced Military Cryptography'' (1931) and in the later
Military Cryptanalysis and
Military Cryptanalytics ''Military Cryptanalytics'' (or MILCRYP as it is sometimes known) is a revision by Lambros D. Callimahos of the series of books written by William F. Friedman under the title ''Military Cryptanalysis''. It may also contain contributions by other cr ...
series.
Friedman's co-author on ''
Military Cryptanalytics ''Military Cryptanalytics'' (or MILCRYP as it is sometimes known) is a revision by Lambros D. Callimahos of the series of books written by William F. Friedman under the title ''Military Cryptanalysis''. It may also contain contributions by other cr ...
'',
Lambros D. Callimahos described the cipher in
Collier's Encyclopedia
''Collier's Encyclopedia'' is a discontinued general encyclopedia first published in 1949 by P. F. Collier and Son in the United States. With '' Encyclopedia Americana'' and ''Encyclopædia Britannica, Collier's Encyclopedia'' became one of the th ...
in the ''Cryptography'' article.
The encyclopedia description was then adapted into an article in ''The Cryptogram'' of the
American Cryptogram Association
The American Cryptogram Association (ACA) is an American non-profit organization devoted to the hobby of cryptography, with an emphasis on types of codes, ciphers, and cryptograms that can be solved either with pencil and paper, or with computers, ...
in 1972.
After this, the cipher became a regular cipher type in ACA puzzles.
In 1987, Noel Currer‐Briggs described the
double Playfair cipher used by Germans in World War II.
In this case, ''double Playfair'' refers to a method using two
Polybius square
The Polybius square, also known as the Polybius checkerboard, is a device invented by the ancient Greeks Cleoxenus and Democleitus, and made famous by the historian and scholar Polybius. The device is used for fractionating plaintext characters s ...
s plus seriation.
Even variants of Double Playfair that encipher each pair of letters twice are considered weaker than the
double transposition cipher.
[
WGBH Educational Foundation]
"The Double Playfair Cipher"
2000.
Other slight variants, also incorporating seriation, are described in Schick (1987)
and David (1996).
The two-square cipher is not described in some other 20th century popular cryptography books e.g. by
Helen Fouché Gaines (1939) or William Maxwell Bowers (1959), although both describe the
Playfair cipher
The Playfair cipher or Playfair square or Wheatstone–Playfair cipher is a manual symmetric encryption technique and was the first literal digram substitution cipher. The scheme was invented in 1854 by Charles Wheatstone, but bears the name o ...
and
four-square cipher
The four-square cipher is a manual symmetric encryption technique. It was invented by the French cryptographer Felix Delastelle.
The technique encrypts pairs of letters (''digraphs''), and thus falls into a category of ciphers known as polygrap ...
.
Using two-square
The two-square cipher uses two 5x5 matrices and comes in two varieties, horizontal and vertical. The horizontal two-square has the two matrices side by side. The vertical two-square has one below the other. Each of the 5x5 matrices contains the letters of the alphabet (usually omitting "Q" or putting both "I" and "J" in the same location to reduce the alphabet to fit). The alphabets in both squares are generally
mixed alphabets, each based on some keyword or phrase.
To generate the 5x5 matrices, one would first fill in the spaces in the matrix with the letters of a keyword or phrase (dropping any duplicate letters), then fill the remaining spaces with the rest of the letters of the alphabet in order (again omitting "Q" to reduce the alphabet to fit). The key can be written in the top rows of the table, from left to right, or in some other pattern, such as a spiral beginning in the upper-left-hand corner and ending in the center. The keyword together with the conventions for filling in the 5x5 table constitute the cipher key. The two-square algorithm allows for two separate keys, one for each matrix.
As an example, here are the vertical two-square matrices for the keywords "example" and "keyword":
E X A M P
L B C D F
G H I J K
N O R S T
U V W Y Z
K E Y W O
R D A B C
F G H I J
L M N P S
T U V X Z
Algorithm
Encryption using two-square is basically the same as the system used in
four-square
Four square is a team sport played among two teams with two players each on a square court divided into four quadrants: A, B, C, and D (usually numbers 3, 4, 2, and 1, respectively, depending on the court.) The square that a player gets to befo ...
, except that the plaintext and ciphertext digraphs use the same matrixes.
To encrypt a message, one would Follow these steps:
* Split the payload message into digraphs. (''help me obi wan kenobi'' becomes ''he lp me ob iw an ke no bi'')
* For a vertical two-square, the first character of both plaintext and ciphertext digraphs uses the top matrix, while the second character uses the bottom.
* For a horizontal two-square, the first character of both digraphs uses the left matrix, while the second character uses the right.
* Find the first letter in the digraph in the upper/left text matrix.
E X A M P
''L'' B C D F
G H I J K
N O R S T
U V W Y Z
K E Y W O
R D A B C
F G H I J
L M N P S
T U V X Z
* Find the second letter in the digraph in the lower/right plaintext matrix.
E X A M P
''L'' B C D F
G H I J K
N O R S T
U V W Y Z
K E Y W O
R D A B C
F G H I J
L M N ''P'' S
T U V X Z
* A rectangle is defined by the two plaintext characters and the opposite corners define the ciphertext digraph.
E X A M P
L B C ''D'' F
G H I J K
N O R S T
U V W Y Z
K E Y W O
R D A B C
F G H I J
''L'' M N P S
T U V X Z
Using the vertical two-square example given above, we can encrypt the following plaintext:
Plaintext: he lp me ob iw an ke no bi
Ciphertext: HE DL XW SD JY AN HO TK DG
Here is the same two-square written out again but blanking all of the values that aren't used for encrypting the digraph "LP" into "DL"
- - - - -
L - -
D -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
L - -
P -
- - - - -
The rectangle rule used to encrypt and decrypt can be seen clearly in this diagram. The method for decrypting is identical to the method for encryption.
Just like Playfair (and unlike four-square), there are special circumstances when the two letters in a digraph are in the same column for vertical two-square or in the same row for horizontal two-square. For vertical two-square, a plaintext digraph that ends up with both characters in the same column gives the same digraph in the ciphertext. For horizontal two-square, a plaintext digraph with both characters in the same row gives (by convention) that digraph with the characters reversed in the ciphertext. In cryptography this is referred to as a transparency. (The horizontal version is sometimes called a reverse transparency.) Notice in the above example how the digraphs "HE" and "AN" mapped to themselves. A weakness of two-square is that about 20% of digraphs will be transparencies.
E X A M P
L B C D F
G
H I J K
N O R S T
U V W Y Z
K
E Y W O
R D A B C
F G H I J
L M N P S
T U V X Z
Two-square cryptanalysis
Like most pre-modern era ciphers, the two-square cipher can be easily cracked if there is enough text. Obtaining the key is relatively straightforward if both plaintext and ciphertext are known. When only the ciphertext is known, brute force
cryptanalysis of the cipher involves searching through the key space for matches between the frequency of occurrence of digraphs (pairs of letters) and the known frequency of occurrence of digraphs in the assumed language of the original message.
Cryptanalysis of two-square almost always revolves around the transparency weakness. Depending on whether vertical or horizontal two-square was used, either the ciphertext or the reverse of the ciphertext should show a significant number of plaintext fragments. In a large enough ciphertext sample, there are likely to be several transparent digraphs in a row, revealing possible word fragments. From these word fragments the analyst can generate candidate plaintext strings and work backwards to the keyword.
A good tutorial on reconstructing the key for a two-square cipher can be found in chapter 7, "Solution to Polygraphic Substitution Systems," o
Field Manual 34-40-2 produced by the United States Army.
References
See also
*
Topics in cryptography
The following outline is provided as an overview of and topical guide to cryptography:
Cryptography (or cryptology) – practice and study of hiding information. Modern cryptography intersects the disciplines of mathematics, computer scie ...
*
Playfair cipher
The Playfair cipher or Playfair square or Wheatstone–Playfair cipher is a manual symmetric encryption technique and was the first literal digram substitution cipher. The scheme was invented in 1854 by Charles Wheatstone, but bears the name o ...
{{Cryptography navbox , classical
Classical ciphers