featherduster icon indicating copy to clipboard operation
featherduster copied to clipboard

Index out of range error in cryptanalib.evaluate_vigenere_key_length

Open kaushiksk opened this issue 6 years ago • 3 comments

The code

import cryptanalib as ca
ca.evaluate_vigenere_key_length("ucoizsbtkxhtadcg", 10)

Traceback

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "cryptanalib/classical.py", line 226, in evaluate_vigenere_key_length
    ioc_list.append(ind_of_coinc(ciphertext, length))
  File "cryptanalib/classical.py", line 188, in ind_of_coinc
    freq[offset][to_number(text[i*distance+offset])] += 1
IndexError: list index out of range

Get the same error for max_length = 5, 20 as well

kaushiksk avatar Aug 16 '18 07:08 kaushiksk

I'll have to dig into this. This was contributed code I'm not super familiar with. Thank you for the report!

unicornsasfuel avatar Sep 14 '18 13:09 unicornsasfuel

Let me know if you need any help!

kaushiksk avatar Sep 14 '18 15:09 kaushiksk

I would welcome help, pull requests are accepted as long as they respect the contributing rules.

unicornsasfuel avatar Sep 14 '18 16:09 unicornsasfuel