From 754fda80881d7b4b7ee0d86f8bcc1cf02f83a253 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Fri, 22 Nov 2013 10:38:09 +0000 Subject: [PATCH] Fixed vigenere break tests --- break.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/break.py b/break.py index 08b7301..b97c37d 100644 --- a/break.py +++ b/break.py @@ -364,10 +364,10 @@ def vigenere_keyword_break(message, """Breaks a vigenere cipher using a dictionary and frequency analysis - >>> vigenere_keyword_break(keyword_encipher('this is a test message for the ' \ - 'keyword decipherment', 'elephant', 1), \ + >>> vigenere_keyword_break(vigenere_encipher(sanitise('this is a test ' \ + 'message for the vigenere decipherment'), 'cat'), \ wordlist=['cat', 'elephant', 'kangaroo']) # doctest: +ELLIPSIS - ('elephant', 0.7166585201707...) + ('cat', 0.4950195952826...) """ best_keyword = '' best_fit = float("inf") @@ -397,10 +397,10 @@ def vigenere_keyword_break_mp(message, """Breaks a vigenere cipher using a dictionary and frequency analysis - >>> vigenere_keyword_break_mp(keyword_encipher('this is a test message for the ' \ - 'keyword decipherment', 'elephant', 1), \ + >>> vigenere_keyword_break_mp(vigenere_encipher(sanitise('this is a test ' \ + 'message for the vigenere decipherment'), 'cat'), \ wordlist=['cat', 'elephant', 'kangaroo']) # doctest: +ELLIPSIS - ('elephant', 0.7166585201707...) + ('cat', 0.4950195952826...) """ with Pool() as pool: helper_args = [(message, word, metric, target_counts, -- 2.34.1