I am currently making a general purpose tool for cracking a vigenere cipher as part of a project. At the moment, I have coded functions to find the index of coincidence, determine an estimated length of the keyword and also give suggested relative distances of letters that make up the keyword (in a nutshell -> the Kasiski Attack)

I want to be able offer a brute force attack as a last resort if a combination of all other information given fail to produce anything fruitful.

If anybody can help me to point me in the write way to code a function that would generate all combinations of 26 letters in a string of length 1 to a string of length n.

i.e.

"A"

"B"

"C"

.

.

.

"X"

"Y"

"Z"

"AA"

"AB"

"AC"

.

.

.

"ZZZZZZZZZZZ"

I hope I've managed to explain myself properly. If not, look at it in terms of counting up from 1 to, say, a million but with letters A-Z rather than the numbers 0-9.

Any help/links will be greatly appreciated.

~Tangy