Algorithm for breaking Vigenère Cipher (Ruby)