Breaking vigenere cipher

KenTan85 used Ask the Experts™
I want to write a program to break vigenere cipher. I understand the logic how it is encrypted and decrypted. I want to find the key. By using IC and Kasiski method, I am able to find the key length. But after that how do I programmically find the key? I just need to know what is the logic or math formula to do it... Any clues?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2009

The idea is that you perform a frequency analysis for each of the letters of the keyword. So, if you have determined how long the key is, you can identify each letter of the key separately.

It's nicely described here :

(specifically the cracking example)
Here is a nice tool that lets you see the frequency analysis and slide the different alphabets along. It's a manual process but it might give you an idea of what happens 'behind the scenes' in a fully automatic breaker:
Here  is an automatic breaker:
It says the source code is available, if you can use python then all the answers are probably in there. I pasted the example encrypted text from Simon Singh's page that Infinity posted above and it produced an English result as soon as I clicked the analyse button.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial