Polyalphabetic Cipher (Quagmire)

Our cipher type discussions, heretofore, have centered on mono-alphabetic cipher type constructions (single alphabet). It is now time to extend our cipher solving skills to those constructions that use more than one alphabet to key the ciphertext encipherment.

We refer to this cipher construction type as polyalphabetic and this type of keying process takes place in what is known as a periodic cipher.

A periodic cipher is one in which the substitution process takes place in a repetitive manner that coincides with the length of the keyword. If the key word of the cipher is seven letters in length, the cipher will be represented by seven columns and seven different alphabetic substitutions will be used, one for each column in the cipher.

For the encipherment of a period seven cipher, text is written horizontally into seven column lengths. Each column is encoded with its own cipher alphabet, generating what is referred to as a polyalphabetic cipher. Plaintext for “The Tyro Gram column is written for the young at heart” would read:

1 2 3 4 5 6 7
t h e t y r o
g r a m c o l
u m n i s w r
i t t e n f o
r t h e y o u
g a t h e a r
t.

Each column is enciphered with an alphabet that begins with the keyword letter representing its column. Unlike the simple substitution type mono-alphabetic cipher, a polyalphabetic cipher permits a letter to stand for itself. Self-encryption permitted.)

Let’s use the keyword CRYPTIC to encode our tyro gram plaintext. Our ciphertext alphabets for the seven columns become:

  abcdefghijklmnopqrstuvwxyz
1 CDEFGHIJKLMNOPQRSTUVWXYZAB
2 RSTUVWXYZABCDEFGHIJKLMNOPQ
3 YZABCDEFGHIJKLMNOPQRSTUVWX
4 PQRSTUVWXYZABCDEFGHIJKLMNO
5 TUVWXYZABCDEFGHIJKLMNOPQRS
6 IJKLMNOPQRSTUVWXYZABCDEFGH
7 CDEFGHIJKLMNOPQRSTUVWXYZAB

The ciphertext letters for each column number are now used to encipher the plaintext message. Substituting the ciphertext letters in each column for the plaintext letters at the

top of the above table we arrive at the following enciphered message:

Ciphertext:

C R Y P T I C
1 2 3 4 5 6 7
V Y C I R Z Q
I I Y B V W N
W D L X L E T
K K R T G N Q
T K F T R W W
I R R W X I T
V.

        Written out in five letter groups, the cipher would appear:

        VYCIR  ZQIIY  BVWNW  DLXLE  TKKRT

       GNQTK  FTRWW  IRRWX  ITV.

The solving process puts all of the principles that we have discussed here into reverse.

Conventional ciphers are much longer in length than the one we have reviewed here and allow us to use frequency analysis by column to make inroads into the plaintext.

Previously our cipher type analysis has discussed only those ciphers free from the need of period determination. If we are to extend our solving prowess to all cipher types it is necessary for us to learn how to determine the period length, or number of columns, in a periodic cipher.

A periodic cipher is one in which the substitution process takes place in a repetitive manner that coincides with the length of the keyword. If the key-word of the cipher is seven letters in length, the cipher will be represented by seven columns with seven different alphabet substitutions, one for each column in the cipher. Polyalphabetic substitution ciphers use multiple lines of keyed ciphertext to cover a message’s plaintext instead of the mono-alphabetic process of one keyed line of ciphertext letters.

Period Determination

Let’s begin the discussion of how to detect the period length or number of columns in a cipher with those ciphers that reveal period determination by a simple repetition of letters.

Quagmire ciphers fall in this category. A crib always accompanies these ciphers.

Q-1, JF 1997 Cm E-21. Quagmire II. Cloudburst. (shortestrecordedperiod.)     LIONEL

TEFCB JUTHA QAWHJ UBHBJ FIDJH WETRV
   sh ortes treco rdedp eriod
WDGCK UTGAK JIEAO DQPWR GWJHU RWDXP

TWWXU MCNFE UKVSE NATTF KZAAN DGTBM

HAWVX REMJD XYWHU EBMZL LFSDL FQRRW.

We have placed the crib correctly. Let’s see how this determination was made. We begin by looking for repetitive intervals in the given crib, shortestrecordedperiod. We have the letters, s, o, r, t, e and d as our repeated letters in the crib with intervals of 2, 3, 4, 5, 6, 8, 9 and 10 spaces appearing at different points between these repeated letters.

One of these intervals will be the cipher’s Period, keeping in mind the term Period refers to a reoccurring definite interval, cyclical in nature. Now we determine which of the intervals proves to be the cipher’s foundation. The interval that properly reflects like ciphertext letters for like plaintext letters will generate the proper periodic repetition. We try different periodic column formats until we find like ciphertext letters representing like plaintext letters.

Interval/Period Nine Table

123456789 123456789 123456789
TEFCBJUTH DQPWRGWJH HAWVXREMJ
  shorte
AQAWHJUBH URWDXPTWW DXYWHUEBM
strecorde
BJFIDJHWE XUMCNFEUK ZLLFSDLFQ
dperiod
TRVWDGCKU VSENATTFK RRW.

TGAKJIEAO ZAANDGTBM

Note ciphertext letters “J, U and H” represent plaintext letters “o, r and e” on the first three lines of the Period Nine ciphertext format. A look at all other possible repeated crib letter space intervals will not yield matches of all repetitive letters. Once a ciphertext letter is identified in each Period column (1-9) it retains the same identity within the column. This allows us to place the lower case plaintext letters as shown below. Read down each nine column matrix for the plaintext.

Period Nine Columnar Format

123456789      123456789      123456789
TEFCBJUTH      DQPWRGWJH      HAWVXREMJ
   shorte       t e    e
AQAWHJUBH      URWDXPTWW      DXYWHUEBM
strecorde                        ec  d
BJFIDJHWE      XUMCNFEUK      ZLLFSDLFQ
dperiod           s
TRVWDGCKU      VSENATTFK      RRW.

TGAKJIEAO      ZAANDGTBM
                 r    d

You are familiar with the K2 Keyword Alphabet in usage with an Aristocrat simple substitution cipher. The plaintext normal alphabet is on the top and the keyed ciphertext alphabet beneath. The Quagmire II Cipher uses the same K2 Keyword alphabet approach but since it is a polyalphabetic cipher type, it will have multiple keyword lines under the normal plaintext alphabet. Each of these lines represents a Period in the cipher. This Period Nine, Quagmire II cipher will have nine keyword lines.

Each keyword line contains the same keyword but begins its ciphertext line with a letter that will generate a vertical keyword under the plaintext “a” column of the Keyword matrix.

 Let’s plug in the ciphertext letters that have been identified into our Keyword matrix. The Period column number is shown on the left side.

  a b c d e f g h i j k l m n o p q r s t u v w x y z
1       B                             A
2                               J       Q
3         F                         A
4         W                         I C                  
5       H       B D
6                             J
7         H                         U
8         B                             T
9           H

Since each keyword line contains the same keyword, the ciphertext (CT) letter sequence will be the same in each line. Since CT letters B and D are 5 and 6 spaces from CT letter H on line 5, they may be placed the same distance away on any other line that H appears. Be sure that the same space is kept between the letters. Our keyword matrix is now:

Q-2, Keyword Matrix

  a b c d e f g h i j k l m n o p q r s t u v w x y z
1       B D F             U           A T         H
2                               J       Q
3     B D F             U           A T         H
4         W                         I C
5     H         B D F             U           A T
6                               J     Q
7         H       B D F             U           A T
8         B D F             U         A T         H
9           H         B D F           U           A T

Q-1, Period Nine Plaintext Updated

123456789     123456789     123456789
TEFCBJUTH     DQPWRGWJH     HAWVXREMJ
T eshorte     et e    e     y
AQAWHJUBH     URWDXPTWW     DXYWHUEBM
strecorde     m     y       e  ec  d
BJFIDJHWE     XUMCNFEUK     ZLLFSDLFQ
dperiod       s   m                f
TRVWDGCKU     VSENATTFK     RRW
t  e    s         w yf
TGAKJIEAO     ZAANDGTBM
t r    s        r i yd

Additional keyword ciphertext and plaintext generate one another. Complete each. The additional plaintext generated by adding ciphertext letters to the keyword matrix based on the same letter sequencing of each keyword line allows us to make educated assumptions of yet additional plaintext.

The second plaintext letter of the message is obviously an “h.” It is also obvious that the cipher is referencing “The shortest recorded period of time . . .” “rainy day” is prompted by the cipher’s title, Cloudburst, in ciphertext group ten and “expected” jumps out at us in group twelve. Continue to complete the plaintext and Keyword matrix until you are finished.

Quagmire Cipher Review

  1. Period length is determined by finding the proper interval between repeated crib letters that will allow repeated ciphertext letters to stand for the repeated letters in the crib.
  2. Each keyword matrix line contains the same keyword which generates the identical alphabetical letter sequencing in each line, causing letters sequencing to appear at like intervals.
  3. When any two lines of ciphertext alphabets appear with a letter in common, the information may be combined. The alphabets are identical, simply shifted against each other.
  4. An indicator key letter in the first column of the keyword matrix may form a vertical keyword.
  5. The Quagmire polyalphabetic cipher allows a letter to be substituted for itself.
  6. Quagmires I, II, III and IV follow the same keyword principles as simple substitution with the exception of the fourth review point above.

Period Determination

We stated that a Quagmire’s period length is determined by finding the proper interval between repeated crib letters which will allow like ciphertext letters to represent the repeated letters in the crib. This is a trial and error procedure that is best concentrated in the area of five to ten Period columns for an average length cipher. Sort the text into five columns as a start, looking for a match of repeated ciphertext (CT) and plaintext (pt) letters. If no match exists for each of the repeated CT/pt letters, continue searching for the columnar Period break that produces the proper match.

The ACA and You Handbook can provide Period length assistance based on the number of ciphertext letters in a construction with guidelines that spell out ACA minimum and maximum limitations.

Each keyword matrix line contains the same keyword. This means that each of the period lines generates the same alphabetical sequencing and letters will appear at like intervals. For a Quagmire II, plaintext letters appear at the top of the matrix with the ciphertext letters below containing the keyword. An indicator key letter in the first column of the keyword matrix forms a vertical keyword. 

A note on educational reading – Speed-reading of educational material is appropriate for overview purposes only. Line by line understanding is a necessary requirement of all material that we wish to permanently digest and store to memory.