# Double permutation patterns for transposition ciphers, how to crack

I'm reading from Cornell , I know for a single permutation, I can find the ciphertext length (100), divide in some key lengths (10x10, 5x20), then try all permutation (10x9x8... 5x4x3x2x1). then find anything legible.

Is there any case the above method will not work, and is there any better method to crack this permutation cipher?

Also, what if I use two-permutation patterns, for example; for the 100 plaintext length:

• I divide it into 10 characters per column.
• Then for the first 4 characters - I use one permutation.
• For the next 6 characters, I use another permutation.

Am I right that this makes no difference on the cracking step? i.e. I tried 10x10, then I tried all permutations 10! I will find anything legible.

• Using 2 permutations is identical to using 1 permutation that doesn't shuffle as well. It actually makes it easier to break the transposition. – Serpent27 Sep 27 '20 at 18:30
• Also, the method you propose works in every case, but it's not the best solution. You can actually break such ciphers trivially, even for large plaintexts. I outline such an attack in my answer. – Serpent27 Sep 27 '20 at 18:32
• – kelalaka Sep 27 '20 at 19:05

While transposition ciphers may move bits around, they are entirely linear; and effectively perform substitution... except the data positions are substituted, instead of the values.

Let's say I have the ciphertext

raspberry

and I encrypt it to get

bsapryrre

Statistical analysis becomes even easier than with a substitution cipher: I simply look for a word or set of words with the same count of each letter. Once I have a set of possible plaintexts (there won't necessarily be only 1 match) I effectively have a reduced set of possible plaintexts, one of which forms a known plaintext.

If I have the next ciphertext block as

ip

I can perform the same attack on the next block, effectively creating a series of anagrams. In fact, this attack is so simple that it's already been implemented on every online anagram solver.

I might find multiple choices choices with meaning:

• raspberry pi
• raspberry ip

Since one makes more sense than the other, you know what your message is. This principal can be applied indefinitely to break transposition ciphers without even needing to break the key.

• but if raspberrypi (removed space), then key one, ras -> sar, key two: pberrypi-> ipyrrebp. So, the ciphertext is saripyrrebp, then it is hard to loook for a word without knowing the space. then the only way is still try all possible key length 1..2..11.., then try all combinations of each key length, say, key length =11, then all combinations 11! to find that saripyrrebp is raspberrypi? – pianobegginer Sep 28 '20 at 15:31
• The space becomes irrelevant to the difficulty of the attack. There's a multiple-word anagram solver here that proves how easy is is to break. Anagrams have been used for hundreds of years and have long since become nothing more than fun little puzzles to for bored old people. They'll even try anagrams of entire sentences if they're really ambitions. In the end, the attack doesn't even care about the presence of a space, since it simply guesses possible plaintexts until one starts to make sense. – Serpent27 Sep 28 '20 at 19:44
• The entire attack, if you check partial plaintexts as a means of optimization, takes about $O(n^2)$ time for an $n$ word message. Even if you have 100 words, that's still computationally quite easy... Although maybe not on a web browser in JavaScript. If you'd like to know more about what I'm describing I will be updating my answer soon to explain in more detail. – Serpent27 Sep 28 '20 at 19:56