Introduction to Cryptography
First programming project
Due Tuesday, February 4, 2003

The point of this project is to cryptanalyze a vigenere cipher. Your program should input the ciphertext from a file, and then output the decrypted text. Your program should use both the Kasiski test and the index of coincidence test to determine key length, and should then calculate all of the mutual indices of coincidence (Mg) to find the shift used in each key position.

A naive user may not be particularly interested in the intermediate calculations, but I am very interested. So in addition to the final decrypted text, please have your program also output labelled values found by the Kasiski test, the indices of coincidence, the table of values of Mg, and finally the original key. If you don't want these reams of information to interfere with your screen output, then save the information to a file, or have the program allow a "verbose" option.

Please note that the methods of cryptanalysis that we're using work well, but if the text is too short, or if the original plaintext itself varies much from standard English in its distribution of characters, then the algorithm may not always produce the correct plaintext. You can alleviate this problem somewhat by allowing the user to experiment with keylengths. You might want to output to the user the results of the Kasiski test, along with your best guess for keylength using the indices of coicincidence, and then allow them to choose the keylength.

Here are some samples:
Sample 1 (from textbook)
Sample 2
Sample 3
Sample 4
Sample 5
Sample 6
Sample 7
Sample 8
Sample 9
Sample 10