From 4e9f450d68d08524e6d2d9d68e23792352d2ef2c Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Sun, 27 Oct 2019 17:23:18 +0000 Subject: [PATCH] Changed simulated annealing breaks to use trigrams by default --- cipher/keyword_cipher.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cipher/keyword_cipher.py b/cipher/keyword_cipher.py index 2028182..fc8eb1c 100644 --- a/cipher/keyword_cipher.py +++ b/cipher/keyword_cipher.py @@ -160,7 +160,7 @@ def monoalphabetic_break_hillclimbing(message, max_iterations=20000, plain_alphabet=None, cipher_alphabet=None, - fitness=Pletters, chunksize=1): + fitness=Ptrigrams, chunksize=1): return simulated_annealing_break(message, workers=1, initial_temperature=0, @@ -175,7 +175,7 @@ def monoalphabetic_break_hillclimbing_mp(message, max_iterations=20000, plain_alphabet=None, cipher_alphabet=None, - fitness=Pletters, chunksize=1): + fitness=Ptrigrams, chunksize=1): return simulated_annealing_break(message, workers=workers, initial_temperature=0, @@ -190,7 +190,7 @@ def simulated_annealing_break(message, workers=10, max_iterations=20000, plain_alphabet=None, cipher_alphabet=None, - fitness=Pletters, chunksize=1): + fitness=Ptrigrams, chunksize=1): worker_args = [] ciphertext = sanitise(message) for i in range(workers): -- 2.34.1