Suppose we want to encrypt the plaintext message (where "x"
represents a space)
attackxatxdawn
In a double transposition cipher, we would put the
plaintext into an array
and permute the rows and columns. For example, we could
put the message above into a 3 x 5 matrix as below.
col 1 | col 2 | col 3 | |
---|---|---|---|
row 1 | a | t | t |
row 2 | a | c | k |
row 3 | x | a | t |
row 4 | x | d | a |
row 5 | w | n | x |
Suppose we permute the columns (1,2,3) → (1,3,2) and the rows (1,2,3,4,5) → (3,5,1,4,2). The result is
col 1 | col 3 | col 2 | |
---|---|---|---|
row 3 | x | t | a |
row 5 | w | x | n |
row 1 | a | t | t |
row 4 | x | a | d |
row 2 | a | k | c |
Then the ciphertext is
xtawxnattxadakc
Anyone who knows the key (i.e., the row and column permutations)
can easily recover the plaintext.