Transposition Cipher
Description
The idea behind a transposition cipher is to create a
permutation (rearrangement) of the letters of the plaintext that will
make the ciphertext appear to be well-encrypted. Transposition ciphers are
not highly secure because they do not change the letters in the plaintext
or even cover up frequencies, but they can be built upon to make more
secure methods of encryption. One example of transposition cipher is
the rail fence
cipher.
Example
The rail fence cipher is a very simple columnar
transposition that takes a string and splits the letters into two groups
by way of a zigzag pattern, as shown below:
Encipher
plaintext = When drinking water, remember its
source.
compressed plaintext = whendrinkingwaterrememberitssource
zig:
|
W
|
|
E
|
|
D
|
|
I
|
|
K
|
|
N
|
|
W
|
|
T
|
|
R
|
|
E
|
|
E
|
|
B
|
|
R
|
|
T
|
|
S
|
|
U
|
|
C
|
|
zag:
|
|
H
|
|
N
|
|
R
|
|
N
|
|
I
|
|
G
|
|
A
|
|
E
|
|
R
|
|
M
|
|
M
|
|
E
|
|
I
|
|
S
|
|
O
|
|
R
|
|
E
|
zig = WEDIKNWTREEBRTSUC
zag = HNRNIGAERMMEISORE
ciphertext = zig + zag
ciphertext = WEDIKNWTREEBRTSUCHNRNIGAERMMEISORE
Decipher
To decipher, simply cut the ciphertext in half and create a new string
with alternating letters from both substrings.
substring_1 = WEDIKNWTREEBRTSUC
substring_2 = HNRNIGAERMMEISORE
newstring = W + H + E + N + D + R + \85 + U + R + C + E"
Scytale Cipher
In 4th century B.C., a device named a scytale
was used to encrypt Spartan government and military messages. The device
consisted of a cylinder of wood with a strip of paper wrapped around it.
When the paper was removed, it was simply a string of jumbled letters but, while
wrapped around the device, the message was clearly revealed. The scytale
takes the idea of the rail fence cipher and expands
upon it by using a key of a given length to help conceal the message.
Encipher
plaintext = When drinking water, remember its
source.
compressed plaintext = whendrinkingwaterrememberitssource
compressed plaintext length = 34
chosen key length = 4
Dividing the plaintext length of 34 by the key length of 4 gives 8 with a remainder
2. So we round the length of each row of the scytale up to 9 and pad the message with
two letter "z"s.
W
|
H
|
E
|
N
|
D
|
R
|
I
|
N
|
K
|
I
|
N
|
G
|
W
|
A
|
T
|
E
|
R
|
R
|
E
|
M
|
E
|
M
|
B
|
E
|
R
|
I
|
T
|
S
|
S
|
O
|
U
|
R
|
C
|
E
|
Z
|
Z
|
:: the scytale unit itself ::
By lining up the letters from each column and moving
left to right we get the ciphertext:
WIESHNMSEGEONWMUDABRRTECIERENRIZKRTZ
Looking at this ciphertext alone, the original message is disguised to the
eye.
Decipher
To decrypt, knowing that the key is of size 4, so we
write the first four characters from top to bottom, then the next four
character adjacent to the first column and so on. Reading the letters from
each row and discarding the final padded characters, we get the plaintext
Disadvantages
In the case of small messages, the ciphertext is easily deciphered by
anyone willing to try deciphering with different key values.
Ciphertext length 36 is divisible by 3 so we first test with a key of 3,
resulting in...
WSMGNUBTIEIR
IHSEWDREENZT
ENEOMARCRRKZ
which when read line by line obviously proves not be English, so we can
deduce that the key is not 3.
Testing with a key of 6, which also divides evenly into 36, gives us...
WMNBII
ISWREZ
EEMRRK
SGUTER
HEDENT
NOACRZ
which again is clearly not the correct answer. In fact, we didn't even
have to plot out the entire answer here, because after putting in the
second column, our first word was shown to begin with "WM," and
no English language word begins that way. Therefore a key of 6 could not
work.
A test using a key of length 4 will show the correct answer:
WHENDRINK
INGWATERR
EMEMBERIT
SSOURCEZZ
This becomes "WHENDRINKINGWATERREMEMBERITSSOURCEZZ," which is
clearly the correct answer.
The rail fence cipher is more of a learning tool than a
practical cipher, as its overly simple design allows virtually anyone to
crack it. Despite this, the scytale cipher can actually be a useful tool
for applications such as quick message passing and in other situations
where the decoding must be done by hand.
The main problem with both of these ciphers is that the actual letters are
not changed, so frequency counts reveal not only trends in letter
repetition but the actual plaintext letter that the ciphertext is linked
to (because they are the same letter!). Generally speaking, having the
plaintext and ciphertext letters line up exactly with each other always
leads to easily deciphered messages.
|