Breaking a Modified Caesar Cipher Does anyone know of an efficient way of breaking a modified Caesar cipher (where the key is a set of numbers (the amount of shift) that is repeated throughout the plaintext, e.g. {1,2,3,4,5}) via brute-force?

The way I'm currently trying to crack it is as follows:


Generate all possible key combinations ( 5 numbers between 1 &amp; 25)
Use the generated key to "decipher" the message
Use frequency analysis on deciphered messages to see which one is the best fit


As you can probably guess, the way I've come up with is the least efficient (in terms of time and memory) and I was wondering what would be the best way to decipher the message.
Assume the length is $n$. If the cipher text is $c_0, c_1, c_2, \ldots, c_N$ then consider the sub-text consisting of the characters $c_0, c_n, c_{2n},\ldots$. These have all been encrypted with the same Caesar, and you can break it by frequency analysis (the shifted 'e' should be the most common in standard English texts, or else maybe the 't' etc.). Suppose the shift you find is $s_0$. Then try the shifts $s_0 + 1, \ldots s_0 + (n-1)$ for the next sub-texts and see if you have a result. If not, try another $n$. This way you only brute force over $n$, essentially.

You could also determine the length $n$ by a statistical method (index of coincidence) or Kasiski (finding long repeats) as well. These will work for any Viginère cipher. But the above might be simpler if you already know that the shifts will be cyclic and consecutive.