Transposition Techniques:: 1. Rail Fence Rail Fence
Transposition Techniques:: 1. Rail Fence Rail Fence
Transposition Techniques:: 1. Rail Fence Rail Fence
1. Rail Fence
The simplest such cipher is the rail fence technique, in which:
• Write message letters out diagonally over a number of rows.
• Then read off cipher row by row.
For example, to encipher the message “meet me after the toga party”
with a rail fence of depth 2, we write the following:
---------------------------------------------------------------------------------------------------------------
Principles of Cryptography Dr. OmaimaBahaidara
1
To cipher it:
1. Write plaintext in a rectangle row by row.
2. Permute the order of the columns.
3. Read the message off, column by column.
To decipher it:
The recipient has to work out the column lengths:
1. By dividing the ciphertext length by the key length
2. Then he can write the message out in columns again, by re-
order the columns by reforming the key word
Example,
Key: 4 3 1 2 5 6 7
Plaintext: attack postponed until two am
a t t a c k p
o s t p o ne
d u n t i l t
woam
Thus, in this example, the key is 4312567.To encrypt, start with the
column that is labeled 1, in this case column 3.Write down all the letters
in that column. Proceed to column 4, which is labeled 2, then column 2,
then column 1, then columns 5, 6, and 7.
A pure transposition cipher is easily recognized because it has the same
letter frequencies as the original plaintext. For the type of columnar
transposition just shown, cryptanalysis is fairly straightforward and
---------------------------------------------------------------------------------------------------------------
Principles of Cryptography Dr. OmaimaBahaidara
2
involves laying out the ciphertext in a matrix and playing around with
column positions. Digram and trigram frequency tables can be useful.
The transposition cipher can be made significantly more secure by
performing more than one stage of transposition. The result is a more
complex permutation that is not easily reconstructed. Thus, if the
foregoing message is reencrypted using the same algorithm,
Key: 4 3 1 2 5 6 7
Input: t t n a a p t
m t s u o a o
d w c o i k n
l p e t
Product Ciphers
Have seen that ciphers based on just substitutions or transpositions are
not secure, and can be attacked because they do not sufficient obscure the
underlying language structure
So consider using several ciphers in sequence to make harder, but:
▪ two substitutions make a more complex substitution
▪ two transpositions make more complex transposition
▪ but a substitution followed by a transposition makes a new
much harder cipher
A substitution followed by a transposition is known as a Product
Cipher, and makes a new much more secure cipher, and it is bridge from
classical to modern ciphers.
---------------------------------------------------------------------------------------------------------------
Principles of Cryptography Dr. OmaimaBahaidara
3