From: Neil Smith Date: Fri, 22 Nov 2013 10:38:09 +0000 (+0000) Subject: Fixed vigenere break tests X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=754fda80881d7b4b7ee0d86f8bcc1cf02f83a253;p=cipher-tools.git Fixed vigenere break tests --- 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,