• Missing test case: key starting with repeated data

Question related to mission Vigenere Cipher

 

I found quite a few solutions that all had problems cracking a personal test case of mine.

decode_vigenere(
    "DOESNOTWORKINALLCASES",
    "RVSZBVLKQFYTBHZSQHKSU",
    "VLFLOUWLCADWSVTHPYGYGBQLGL"))

This should yield the outcome:

HEREANEXAMPLEOFABROKENCASE

The original key was "OHOHOHSOCOOL". In the solutions that were not able to crack the code, the two most standard issues were using "OHOHOHSOCOOLOHOHOHSOC" as the key (which only works if len(newencrypted) <= len(oldencrypted)) and using "OH" as the key (due to using a wrong algorithm for detecting the key based on the repetition pattern).

Maybe it is a good idea to add a test for a case like this to the test set?