File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,9 +208,15 @@ def find_key_from_vigenere_cipher(ciphertext: str) -> str:
208208
209209
210210if __name__ == "__main__" :
211- pass
211+ print ( "" )
212212 # # how to execute
213- # with open("ciphertext .txt") as file:
213+ # with open("out .txt") as file:
214214 # ciphertext = file.read()
215215 # key = find_key_from_vigenere_cipher(ciphertext)
216216 # print(key)
217+
218+
219+
220+ # ---------- TESTS ----------
221+ # def test_index_of_coincidence(f)
222+
Original file line number Diff line number Diff line change 1+ import unittest
2+ from ciphers .break_vigenere import *
3+
4+
5+ class TestBreakVigenere (unittest .TestCase ):
6+ def test_index_of_coincidence (self ):
7+ dictionary = {'a' : 5 , 'b' : 1 , 'c' : 4 }
8+ ic = index_of_coincidence (dictionary , 100 )
9+ self .assertAlmostEqual (ic , 0.0032323232323232 )
You can’t perform that action at this time.
0 commit comments