Tenth edition of the N&O column / Spooks newsletter

(Date: Sat, 30 Jan 1999 13:37:02 +0100 CET)

Press release | Locations | Morse stations | Voice stations | Other modes
Polyalphabetic substitution ciphers | ENIGMA list update | Logs
Index | NS NL Home


Polyalphabetic substitution

by Torbjorn Andersson

(Torbjorn's web site)


Table of contents

Introduction

In polyalphabetic substitution the cleartext letters are enciphered differently depending upon their placement in the text. As the name polyalphabetic suggests this is achieved by using several cryptoalphabets instead of just one, as is the case in most of the simpler crypto systems. Which cryptoalphabet to use at a given time is usually guided by a key of some kind, or the agreement can be to swich alphabet after each word encrypted (which, of course, presumes that the word boundaries are kept intact or indicated in some way), but the latter is seldom practiced in real life. Several systems exists, and I shall try and explain some of the more common.

Gronsfeld's system

One of the simplest polyalphabetic substitution ciphers is Gronsfeld's system. Gaspar Schott, a German 17-century cryptographer, tells that he was taught this cipher during a trip between Mainz and Frankfurt by count Gronsfeld, hence the name. Gronsfeld's system uses a numeric key - usually quite short - e.g. 7341, and this key is repeated, one figure at a time, above the individual letters of the cleartext, like this:

Key: 7 3 4 1 7 3 4 1 7
Text: G R O N S F E L D

To encrypt, one simply count forwards in the alphabet from the letter to be encrypted, the number of steps given by the key figure above, the resulting letter being the crypto. If one happens to reach the last letter of the alphabet, still having remaining steps to count, one begins from the beginning of the alphabet. It helps to think of the alphabet as a ring of letters, instead of a row.

This is how the example from above will look like:

Key: 7 3 4 1 7 3 4 1 7
Text: G R O N S F E L D
Crypto: N U S O Z I I M K

Decryption is the reverse process. One writes out the key figures above the letters of the cryptogram and counts backwards in the alphabet instead to reach the cleartext. Gronsfeld's system can be made more secure (the original system isn't very safe, even with keys as long as the number of letters in the cleartext) against enemy decryption by using an unordered alphabet instead of the normal sequence. Since there are numerous ways to design an unordered alphabet, I will show but one method. Using the key (or, preferably, another key of one's own choosing) from the example above, the following table is constructed:

7 A E I M Q U Y
3 B F J N R V Z
4 C G K O S W  
1 D H L P T X  

Writing the letters out, row by row, and starting with the row having the lowest keyfigure gives the following unordered sequence:
DHLPTXBFJNRVZCGKOSWAEIMQUY

The encryption example from above will, when counting in this unordered alphabet, look like this:

Key: 7 3 4 1 7 3 4 1 7
Text: G R O N S F E L D
Crypto: I C E R U R U P F

Vigenère

The most common polyalphabetic substitution cipher is the Vigenère or, as it is sometimes referred to, Tritheim's system. It uses a table, usually containing 26 by 26 cells (one 18-century Swedish table uses 22 by 22 cells, and a 19-century one - also Swedish - has 56 by 56 cells, but it was probably too cumbersome to use) containing the letters of the alphabet in the following fashion:

The Vigenère Table
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
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 A
C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
W X Y Z A B C D E F G H I J K L M N O P Q R S T U V
X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
Z 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

There are several ways to use this table, all producing ciphers with different names, such as: Standard Vigenère, Beaufort, Variant Vigenère.

Standard Vigenère

In standard Vigenère the table is used in the following way:

First a keyword or keyphrase is agreed upon by the communicants, e.g. PYRAMID. The letters of the keyword/keyphrase are written above the plaintext to be enciphered one by one, like the keyfigures of the Gronsfeld system. If necessary, the keyword is repeated over and over till all cleartext letters have received one letter of the key. It may look like this:

Key letters: P Y R A M I D P Y R A M I D P
Cleartext: A T T A C K A T S U N D O W N

The plaintext letter is sought in the topmost row of the table and the key letter in the leftmost column of the table. At the intersection of the column under the plaintext letter and the row begun by the key letter, one will find the crypto letter. When the encryption is finished, the example above will have the following appearance:

Key letters: P Y R A M I D P Y R A M I D P
Cleartext: A T T A C K A T S U N D O W N
Crypto: P R K A O S D I Q L N P W Z C

To decipher a cryptogram in standard Vigenère, one copies the letters of the key above the letters of the cryptogram. The row begun by the first keyletter is sought in the table, and then one proceeds along this row until the cryptoletter are encountered. Next, one goes straight up from the cryptoletter to the first row, where the cleartext is found.

The reader might be interested in knowing, that standard Vigenère was the main cryptographic system used by the Confederated States during the American Civil War, and the following four key phrases used by the Confederates have survived to this day:

In the excellent book The History of Codes and Ciphers in the United States prior to World War I, available from AEGEAN PARK PRESS, the following example of a real Confederate message is given, which the interested reader can try and decipher (the key being one of the four mentioned above):

Jackson, May 25th, 1863
Lieut. Genl. Pemberton: My XAFV. USLX was VVUFLSJP
by the BRCYIJ 200,000 VEGT. SUAJ. NERP. ZIFM. It
will be GFOECSZQD as they NTYMNX. Bragg MJ TPHINZG
a QKCMKBSE. When it DZGJX N will YOIG. AS. QHY.
NITWM do you YTIAM the IIKM. VFVEY. How and where
is the JSQML GUGSFTVE. HBFY is your ROEEL.
J. E. Johnston

Beaufort

In the Beaufort cipher the table is used in the following way:

Encryption.
Locate the cleartext letter in the top row of the table. Search the column immediately under till the keyletter is found. Follow the row of the keyletter to the left. The cryptoletter is found in the left most column.
Decryption.
Locate the cryptoletter in the leftmost column of the table. Search the row to the right till the keyletter is found. Go straight up from the keyletter. The cleartext is found in the top row.

The Beaufort way of using the table is somewhat easier than standard Vigenère, since you only have to follow one route instead of finding an intersection of a row and a column.

Variant Vigenère

In Variant Vigenère the following modus operandi is used:

Encryption.
Locate the keyletter in the leftmost column. Follow the row headed by the key letter until the cleartext letter is found. Go straight up from the cleartext letter. The cryptoletter is found in the top row.
Decryption
Locate the cryptoletter in the top row. Locate the keyletter in the leftmost column. The cleartext is found at the intersection of the cryptoletter-column and the key letter-row.

Vigenère with unordered alphabets

As is the case with Gronsfeld's system, the cipher produced by Vigenère will be harder to break by the enemy if unordered alphabets are used instead of the normal alphabetic sequence. Either the mixed sequence is written down in a fashion similar to the Vigenère table above, or the mixed sequence is written on the top line and down, forming a new leftmost column, which are then used when locating the key-, cleartext, and cryptoletters.

A table using a body consisting of a mixed sequence based on the keyword SPHINX may look like this:

Vigenère Table with unordered alphabet
S P H I N X A B C D E F G J K L M O Q R T U V W Y Z
P H I N X A B C D E F G J K L M O Q R T U V W Y Z S
H I N X A B C D E F G J K L M O Q R T U V W Y Z S P
I N X A B C D E F G J K L M O Q R T U V W Y Z S P H
N X A B C D E F G J K L M O Q R T U V W Y Z S P H I
X A B C D E F G J K L M O Q R T U V W Y Z S P H I N
A B C D E F G J K L M O Q R T U V W Y Z S P H I N X
B C D E F G J K L M O Q R T U V W Y Z S P H I N X A
C D E F G J K L M O Q R T U V W Y Z S P H I N X A B
D E F G J K L M O Q R T U V W Y Z S P H I N X A B C
E F G J K L M O Q R T U V W Y Z S P H I N X A B C D
F G J K L M O Q R T U V W Y Z S P H I N X A B C D E
G J K L M O Q R T U V W Y Z S P H I N X A B C D E F
J K L M O Q R T U V W Y Z S P H I N X A B C D E F G
K L M O Q R T U V W Y Z S P H I N X A B C D E F G J
L M O Q R T U V W Y Z S P H I N X A B C D E F G J K
M O Q R T U V W Y Z S P H I N X A B C D E F G J K L
O Q R T U V W Y Z S P H I N X A B C D E F G J K L M
Q R T U V W Y Z S P H I N X A B C D E F G J K L M O
R T U V W Y Z S P H I N X A B C D E F G J K L M O Q
T U V W Y Z S P H I N X A B C D E F G J K L M O Q R
U V W Y Z S P H I N X A B C D E F G J K L M O Q R T
V W Y Z S P H I N X A B C D E F G J K L M O Q R T U
W Y Z S P H I N X A B C D E F G J K L M O Q R T U V
Y Z S P H I N X A B C D E F G J K L M O Q R T U V W
Z S P H I N X A B C D E F G J K L M O Q R T U V W Y

The example from above will now become:

Key letters: P Y R A M I D P Y R A M I D P
Cleartext: A T T A C K A T S U N D O W N
Crypto: B Q J G Y O L U Y K E Z T A X

When using the unordered sequence as top row and leftmost column, the first few lines may look like this:

Vigenère Table with unordered entry alphabets
  s p h i n x a b c d e f g j k l m o q r t u v w y z
s 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
p 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 A
h C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
i D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
n E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
x F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
a G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
b H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
c I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
d J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
e K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
f L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
g M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
j N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
k O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
l P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
m Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
o R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
q S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
r T U V W X Y Z 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 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 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 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 A B C D E F G H I J K L M N O P Q R S T U V W
y Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
z Z 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

The example now becomes:

Key letters: P Y R A M I D P Y R A M I D P
Cleartext: A T T A C K A T S U N D O W N
Crypto: H S N M Y R P V Y O K Z U G F

Press release | Locations | Morse stations | Voice stations | Other modes
Polyalphabetic substitution ciphers | ENIGMA list update | Logs
Index | NS NL Home

---