Time for a little mathemagic! Choose any five cards from a pack and show four of them to your partner. How can they work out the fifth?
Find the frequency distribution for ordinary English, and use it to help you crack the code.
How can Agent X transmit data on a faulty line and be sure that her message will get through?
A transposition cipher is one which rearranges the order of the letters in the ciphertext (encoded text), according to some predetermined method, without making any substitutions.
Suppose we want to encrypt the following message, a quote from 'Peter Rabbit' by Beatrix Potter: "Now run along and don't get into mischief, I'm going out." Let's remove the punctuation and the spaces between the words to get: "nowrunalonganddontgetintomischiefimgoingout".
This is 44 letters long. For reasons we'll soon discover, let's add 4 extra padding characters, "x", at the end to now get: "nowrunalonganddontgetintomischiefimgoingoutxxxx".
We can now write this message in 4 rows, each 12 letters long.
n o w r u n a l o n g a
n d d o n t g e t i n t
o m i s c h i e f i a m
g o i n g o u t x x x x
By reading the letters in order down the columns, instead of along the rows, we get:
"nnog odmo wdii rosh uncg ntho agiu leet otfx niix gnax atmx"
We can now send this message to our friend with the spaces removed, and the message is "hidden".
Suppose the enemy intercepts and wants to decipher our message. What might they do?
Once you have thought about how to decipher a message encoded in this way, read on below:
48 characters can be encoded using grids of one of these dimensions:
$1\times48, 2\times24, 3\times16, 4\times 12, 6 \times 8, 8 \times 6, 12 \times 4...$
The first of these doesn't rearrange the message at all.
The second size gives:
n n o g o d m o w d i i r o s n u n c g n t h o
a g i u l e e t o t f x n i I x g n a x a t m x
Reading down the columns gives "nangoigu....". Definitely not English!
The next arrangement is a 3 by 16 grid:
n n o g o d m o w d i i r o s n
u n c g n t h o a g i u l e e t
o t f x n i I x g n a x a t m x
"nuonntocf", let's try again!
A 4 by 12 grid gives:
n n o g o d m o w d i i
r o s n u n c g n t h o
a g i u l e e t o t f x "nrannogi..."
n i I x g n a x a t m x
and a 6 by 8 grid gives:
n n o g o d m o
w d i i r o s n
u n c g n t h o "nwuaog.."
a g i u l e e t
o t f x n i I x
g n a x a t m x
Hmm, let's keep trying! An 8 by 6 arrangement gives:
n n o g o d
m o w d i i
r o s n u n "nmrcaena...."
c g n t h o
a g i u l e
e t o t f x
n i I x g n
a x a t m x
A 12 by 4 sized grid gives:
n n o g
o d m o
w d i i
r o s n
u n c g
n t h o
a g i u "nowrunalongand....", the start of our original message!
l e e t
o t f x
n i I x
g n a x
a t m x
Can you see why we chose a 48-character message rather than a 44-character message?
Imagine you have intercepted the message below, and you know it has been encrypted using a transposition cipher.
Can you decrypt the message?
You might find it useful to work on squared paper.
If you want to work on a computer to solve the problem, you can download the message as a text file which doesn't contain any line breaks.
There is a transposition solver as part of our Cipher Challenge Toolkit.
If you are interested in code breaking you might enjoy the Secondary Cipher Challenge.