I am writing a program which will use Chi-Square to determine which is the correct keyword for a ciphertext via Vigenere Cipher.
I came across a website that describes the Chi-Square statistics in a rather simplistic manner and had also written some code to achieve my goals. However, the actual keyword does not seem to be the lowest chi-square value as according to the website. I'm not sure if the method as describe is correct or not.
Would someone be able to provide some advice on this?