Say I want to encrypt the following text: \"Today is March the 22nd, 2015\". And
ID: 647487 • Letter: S
Question
Say I want to encrypt the following text: "Today is March the 22nd, 2015". And say want to encrypt 8-byte blocks of data using the following permutation [6,3,0,1,5,7,2,4] to swap characters at those indexes.
[T|o|d|a|y| |i|s| |M| a| r| c| h| | t| h| e| | 2| 2| n| d| ,| | 2| 0| 1| 5]
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Using the encryption key [6,3,0,1,5,7,2,4], encrypting the first block goes like this:
First index is 6, so move the character at index 6 in the plain text to the first position of the ciphertext.
[i]
Second one is 3, so add the character at index 3 to the ciphertext:
[i|a]
When we finish the first block it looks like this (without the "|"):
[i|a|T|o| |s|d|y]
Then continue to do the same for the other blocks.
If the length if the text is not a multiple of the block size, just pad with some character and remove it after decryption.
I can't think of any type of attack except for brute force. This would basically mean generating all permutations of size n (where n is the block size). For block sizes larger than 1KB, it's basically computationally infeasible to break it.
Can anyone think of any other type of attack?
Explanation / Answer
This is called a transposition cipher. It is the kind of thing that was commonplace before the invention of the computer, and some people were really good at breaking that in mere minutes (e.g. Edgar Allan Poe). In all generality, breakage is done by backtracking (wrong hypotheses on permutation elements leading to "impossible digraphs" that cannot occur in normal text).
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.