Transposition ciphers


Introduction

Transposition ciphers are rarely encountered nowadays. They differ from both code systems and substitution ciphers; in a transposition cipher the letters of the plaintext are shifted about to form the cryptogram. This can be done in a number of ways and some systems exist where even whole words are transposed, rather than individual letters. To encrypt Chinese, for instance, one can use a transposition cipher operating on the individual signs of written Chinese (using a substitution cipher for a language like Chinese would be awkward if not impossible).

Single columnar transposition

One of the easiest ways to achieve transposition is the Single Columnar Transposition Cipher. To use it, one needs a keyword or phrase, whose letters are numbered according to their presence in the alphabet. The keyword Ozymandias is numbered in the following way:
 
 
O  Z  Y  M  A  N  D  I  A  S
7 10  9  5  1  6  3  4  2  8
That is, the first occurance of the letter A is numbered 1, the second 2. There are no B:s or C:s so the next letter to be numbered are the D followed by I, and so on.

 Next the plaintext is written in rows under the numbered keyword, one letter under each letter of the keyword. Let's say that the plaintext to be encrypted is Company has reached primary goal. It will look like this:
 
 

O Z Y M A N D I A S 7 10 9 5 1 6 3 4 2 8 c o m p a n y h a s r e a c h e d p r i m a r y g o a l    
Now the letters of the plaintext are copied down by reading them off columnwise in the order stated by the enumeration of the keyword. The result is the finished cryptogram, which - of course - are put into groups of five letters, like this:
 

AHGAR YDAHP LPCYN EOCRM SIMAR OEA

To decrypt a received message enciphered by this method, one first must calculate the number of letters present in the cryptogram. This is done to see how many letters there originally were in the last row. As can be seen above, the two last columns - the ones numbered 2 and 8 - only contains two letters and this is important. Now the cryptogram above contains 28 letters and as a legitimate user of the crypto system, one knows that the keyword is ten letters wide. Therefore the last row must consist of eight letters only, the two final positions being empty. Keeping that in mind - or better still, marking the two final position of row three in some way to indicate that they shouldn't be used - one numbers the keyword letters (just as when encrypting) and then start by writing the first three letters of the cryptogram under keyword letter number one, thus:
 
 

O  Z  Y  M  A  N  D  I  A  S
7 10  9  5  1  6  3  4  2  8
.  .  .  .  a  .  .  .  .  .
.  .  .  .  h  .  .  .  .  .
.  .  .  .  g  .  .  .  *  *
Next comes column number two. Since the last position in column two is marked by a star and shouldn't be used, one only writes the next two letters, instead of three. Continue in the same way by writing the next three letters under keyword letter number three, and so on up to keyword letter eight, it will look like this:
 
 
O  Z  Y  M  A  N  D  I  A  S
7 10  9  5  1  6  3  4  2  8
c  .  .  p  a  n  y  h  a  .
r  .  .  c  h  e  d  p  r  .
m  .  .  y  g  o  a  l  *  *
Now column eight follows, and there only two letters should be written as stated above (the position marked by a star being left empty). This leaves six letters of the cryptogram, and these - of course - are written in column nine and ten, and then the cleartext can be read in the normal way, row by row.

 Usually when employing a transposition cipher like the above, one adds dummy letters to make the final group five letters long if it isn't already full. It is important to do this before transposing the letters, otherwise the receiver can't calculate the columns that haven't a full number of letters if the last row isn't complete. In some cases the last row is always made complete by adding dummy letters, but that reduces the security of the cipher and isn't recommended (now, this cipher is quite easy to break anyway...).


Double columnar transposition

Double columnar transposition is similar to single columnar transposition, but the process is repeated twice. One either uses the same keyword both times or, preferably, a different one on the second occasion. Let's encrypt the text Send armoured car to headquarters using the keywords Agamemnon and Mycenae:
 
 
A G A M E M N O N
1 4 2 5 3 6 7 9 8
s e n d a r m o u
r e d c a r t o h
e a d q u a r t e
r s j            
(Note dummy letter j added at the end to make the total number of letters a multiple of five)

 This first encryption gives: srer-nddj-aau-eeas-dcq-rra-mtr-uhe-oot. These letters are written under the second keyword, thus:
 
 

M Y C E N A E
5 7 2 3 6 1 4
s r e r n d d
j a a u e e a
s d c q r r a
m t r u h e o
o t          
And, finally this gives the cryptogram:
 

DEREE ACRRU QUDAA OSJSM ONERH RADTT

Double columnar transposition is substatially safer against cryptanalysis than single columnar transposition (not impossible, thou).

Here's a link someone sent me, to a program (Microsoft DOS) implementing the double transposition cipher:
Alexander Pukall's Double Transposition Program.
Or, you can download my own program (C-source code and Windows DOS executable):
Toby's Double Transposition Program.


Grilles

Another way to achieve transposition is by means of a so called Grille. A grille usually consists of a square piece of cardboard with cut-out apertures. The grille is placed on a piece of paper, and the corners of the grille are marked on the paper. Then, the plaintext is written, letter by letter in the apertures of the grille. When the last aperture is reached, the grille is turned 90 degrees, and the process continued. If the apertures are properly placed on the grille, turning the grille through all four positions (i.e. 0 degrees, 90 degrees, 180 degrees, and 270 degrees) will not result in any aperture appearing in a position where a letter has already been written on the paper.

Here is an example of such a grille:

Using this grille, and turning it clockwise to encrypt the plaintext "We need more machine gun ammunition fast xx" will look like this:

Removing the grille will reveal the cryptogram:

If the gille is a square, but with an odd number of rows/columns, there will be a centre cell on the grille, which will - of course - always take the same position over the paper. One has to agree on a rule regarding this cell. Is it to be cut out and used when the grille is in the first position only? Or is it to be left uncut, thus leaving a blank cell on the paper when the grille is removed?

Other grille types exist beside the square type shown above. One could e.g. device a rectangular grille, and turn it, first upside down (i.e. 180 degrees), then turn it over, and so on.

Here is an example of a rectangular grille made after those principles:


© Torbjörn Andersson.Torbjörn Andersson Fecit