The following text was encrypted using a simple columnar transposition cipher:
sattvnyanohedtyslerehtwiusvihefneenereiarg
Decrypt the text. What is the correct answer to the question?
(If you still do not know, you can google the phrase.)
The scytale was an encryption tool used to perform a transposition cipher. It consisted only of a rod with a certain diameter around which a leather strap was wound. A message was written on the leather strap, so that only one character was placed in each 'column'. By unwinding the leather band rows and columns were swapped, so that the message now appears as a meaningless string.
Image credit: CC BY-SA 3.0 , https://commons.wikimedia.org/w/index.php?curid=1698345
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
The ciphertext has a length l = n ⋅ m and can be entered in a matrix with width m and height n . Decryption is done by transposing the matrix (swapping rows and columns): plainText [ i ∗ m + j ] = cipherText [ j ∗ n + i ] where i = 0 , … , n − 1 , j = 0 , … , m − 1 . By trial and error we find that n = 7 and m = 6 are the right dimensions for the matrix. The decrypted message is then
which is obviously 42. 42 also happens to be the length of the string. The fact 6 ⋅ 7 = 4 2 was used for the transposition encryption.
Sample code for decryption: