From 987aeffad1db21c614055e849a32f52c37c67b45 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Mon, 7 Oct 2013 14:46:41 +0100 Subject: [PATCH] Removed spurious affine tests --- cipher.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cipher.py b/cipher.py index b086a5d..9bec231 100644 --- a/cipher.py +++ b/cipher.py @@ -178,14 +178,7 @@ def caesar_break(message, metric=norms.euclidean_distance, target_frequencies=no return best_shift, best_fit def affine_break(message, metric=norms.euclidean_distance, target_frequencies=normalised_english_counts, message_frequency_scaling=norms.normalise): - """Breaks a Caesar cipher using frequency analysis - - >>> caesar_break('ibxcsyorsaqcheyklxivoexlevmrimwxsfiqevvmihrsasrxliwyrhecjsppsamrkwleppfmergefifvmhixscsymjcsyqeoixlm') - (4, 0.3186395289018361) - >>> caesar_break('wxwmaxdgheetgwuxztgptedbgznitgwwhpguxyhkxbmhvvtlbhgteeraxlmhiixweblmxgxwmhmaxybkbgztgwztsxwbgmxgmert') - (19, 0.4215290123583277) - >>> caesar_break('yltbbqnqnzvguvaxurorgenafsbezqvagbnornfgsbevpnaabjurersvaquvzyvxrnznazlybequrvfohgriraabjtbaruraprur') - (13, 0.31602920807545154) + """Breaks an affine cipher using frequency analysis """ sanitised_message = sanitise(message) best_multiplier = 0 -- 2.34.1