File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -208,9 +208,15 @@ def find_key_from_vigenere_cipher(ciphertext: str) -> str:
208
208
209
209
210
210
if __name__ == "__main__" :
211
- pass
211
+ print ( "" )
212
212
# # how to execute
213
- # with open("ciphertext .txt") as file:
213
+ # with open("out .txt") as file:
214
214
# ciphertext = file.read()
215
215
# key = find_key_from_vigenere_cipher(ciphertext)
216
216
# 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