I am trying to decrypt a Vigenere chiper, I saw a lot of youtube videos but I still can get a good value for the key length. In theory I have to get the repetions of letters shifting the text one place every iteration and then see how many steps there are between the biggest numbers, but it gives me no common path.

  • 2
    $\begingroup$ Can you be more specific on what you are trying and what the results are? That would be more helpful in knowing where you are getting stuck. $\endgroup$ – mikeazo Sep 18 '17 at 15:42

First find repeating substrings, longer repeating substrings are better. Look at the differences between the index of repeating subsring pairs. Calculate GCD of the differences. If it is a reasonable key length you probably have it. If it came out 1 try dropping some outlier spurious substring occurences. If it came out too large to be a reasonable key you may need to find more repeating substrings allow shorter substrings to be considered.

Motivation: We expect many repeating substrings of common char-grams, in English for instance : th,the,ing and more if these appear in a difference which is a multiple of the key length the cipher text fragments will be identical as well. However such a repeating cipher text is unlikely to appear from encripting some other text in another column.

| improve this answer | |
  • $\begingroup$ Good answer, but what would be really good is if you wrote up a little on why the method works. $\endgroup$ – Awn Sep 18 '17 at 20:13
  • $\begingroup$ [Awn] added motivation section. $\endgroup$ – Meir Maor Sep 19 '17 at 4:10
  • 2
    $\begingroup$ This is a good solution, if one is restricted to breaking the cipher manually. For computers, approaches like Friedman or calculating the auto-correlation should work better and faster (and possibly require less ciphertext). The rationale here is that it takes the entire ciphertext into account and not just the matching bigrams or trigrams. $\endgroup$ – tylo Sep 19 '17 at 12:23
  • $\begingroup$ @tylo I completely agree. I was thinking this is a pencil&paper cipher and I gave a pencil and paper attack. $\endgroup$ – Meir Maor Sep 19 '17 at 15:33

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.