2
$\begingroup$

I have a text that was encrypted twice with two Vigenere keys. However, I know the seven first characters of the decrypted text.

I have already implemented a function displaying for the five first characters the two keys that were possibly used but there are so many possibilities (265 if I am correct)...

I think the answer is no but I'd like be sure. Is there a way of finding the two keys that were used ? Can I use a statistical method even if I don't know the lengths of the keys ?

P.S.: The text is not in English but in German (not very important but for statistical methods, it obviously depends on the language of the text you analyze)

UPDATE: According to the analysis of the text, the LCM of lengths of the keys seems to be equal to 12. If the two keys have 12 characters then it is as if the author had used only one key with 12 characters right ? So if two characters are separated by 11 characters, then they have the same Caesar's shift, don't they ? And if the two keys have different lengths, does it mean that the lengths are either (4,6) or (2,12) or (3,4) ?

$\endgroup$
1
$\begingroup$

Yes, if you encrypt a message twice using the Vigenère cipher with keys of length $a$ and $b$, this is equivalent to encrypting it once with a suitably chosen key whose length equals the least common multiple of $a$ and $b$.

There are more possible key lengths with a least common multiple of 12 than just the ones you listed. Even assuming that $a \le b$, the possible pairs of key lengths include (1,12), (2,12), (3,4), (3,12), (4,6), (4,12), (6,12) and (12,12).

However, as noted above, it doesn't really matter what the original key lengths may have been, since you can just treat the combined cipher as a single Vigenère encryption with a 12-letter key.

In particular, since you already know the first seven letters of the plaintext, you can easily determine the first seven letters of the key, which lets you decrypt more than half of the plaintext. The remaining five key letters should be easy to find incrementally: just try all possible choices for the eighth key letter and see which of the results best fits the adjacent known plaintext. Then do the same for the ninth key letter, and so on.

$\endgroup$
  • $\begingroup$ Thank you very much for your answer. Therefore, since I have the LCM and the 7 first characters of the plain text, can I decrypt a part of the text with the following method ? I create LCM strings by taking one letter ouf of LCM in my encrypted text. For example, my first string starts with the first letter of the encrypted text and the second character of this string is the letter that is LCM-characters away from the first character. The second string starts with the second character of the encrypted text, and so on. Consequently, for 7 of my strings, I can find the Caesar's shift right ? $\endgroup$ – UnknownServer Nov 29 '17 at 14:55
  • $\begingroup$ Your description is really confusing (what are "LCM strings" and "LCM-characters"?), but yes, if you know the first seven letters of the plaintext (and the ciphertext), then you can easily determine the first seven letters of the key. With that many consecutive known key letters, it shouldn't then be hard to guess the remaining key letters one by one. $\endgroup$ – Ilmari Karonen Nov 29 '17 at 15:18
  • $\begingroup$ LCM (Least Common Multiple) is a number, let's take 12 for example . When I wrote LCM strings, I meant 12 strings (if LCM = 12). $\endgroup$ – UnknownServer Nov 29 '17 at 15:30
  • $\begingroup$ But it does not matter. I understood your method. We are actually doing the same thing :) $\endgroup$ – UnknownServer Nov 29 '17 at 15:37
1
$\begingroup$

The key lengths are important, also if it's the Vigenère cipher is applied twice its the same as once with a different keyword. If the two keys are the same length then the new key is that length, if the two keys are different lengths then the new key is sometimes = k1 length * k2 length. If the key length is longer than the message there isn't much analysis you can do.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.