In a columnar transposition, the message is written out in rows of a fixed length. The message is then read out column by column, where the columns are chosen in some scrambled order. The number of columns and the order in which they are chosen is defined by a keyword. For example, the word ZEBRAS is 6 letters long. Therefore, there are 6 columns that will be read off in the following order: 6 3 2 4 1 5. The order is chosen by the alphabetical order of the letters in the keyword.
Regular Case
In a regular columnar transposition cipher, the empty spaces are filled with random letters. For example, suppose we use the keyword ZEBRAS and the message WE ARE DISCOVERED FLEE AT ONCE. Our grid would look like this:
Z E B R A S
6 3 2 4 1 5
- - - - - -
W E A R E D
I S C O V E
R E D F L E
E A T O N C
E Q K J E UThe six columns are now written out in the scrambled order defined by the keyword:
EVLNE ACDTK ESEAQ ROFOJ DEECU WIREE
Irregular Case
In the irregular case, the empty letters are not filled in with random letters:
Z E B R A S
6 3 2 4 1 5
- - - - - -
W E A R E D
I S C O V E
R E D F L E
E A T O N C
EThis results in the following (shorter) ciphertext:
EVLNA CDTES EAROF ODEEC WIREE
To decipher it, the recipient has to work out the column lengths by dividing the message length by the key length. This step is slightly more difficult if the irregular case is used. After determining the number of columns, the message can be written in columns and rearranged back into the plaintext message.
Double Column Transposition
To make the message even more difficult to decipher, you can take the ciphertext produced by this algorithm and run it through the encryption again using a different keyword. This transposes the columns twice and makes the message extremely difficult to decipher.
