projects
/
cipher-tools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
aa16a1b
)
Changed simulated annealing breaks to use trigrams by default
author
Neil Smith
<neil.git@njae.me.uk>
Sun, 27 Oct 2019 17:23:18 +0000
(17:23 +0000)
committer
Neil Smith
<neil.git@njae.me.uk>
Sun, 27 Oct 2019 17:23:18 +0000
(17:23 +0000)
cipher/keyword_cipher.py
patch
|
blob
|
history
diff --git
a/cipher/keyword_cipher.py
b/cipher/keyword_cipher.py
index 20281828030a550948c433f246c8bc05a40622c1..fc8eb1c6847b11dc2a2ea29c40e0934776c84c1c 100644
(file)
--- 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,
max_iterations=20000,
plain_alphabet=None,
cipher_alphabet=None,
- fitness=P
letter
s, chunksize=1):
+ fitness=P
trigram
s, chunksize=1):
return simulated_annealing_break(message,
workers=1,
initial_temperature=0,
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,
max_iterations=20000,
plain_alphabet=None,
cipher_alphabet=None,
- fitness=P
letter
s, chunksize=1):
+ fitness=P
trigram
s, chunksize=1):
return simulated_annealing_break(message,
workers=workers,
initial_temperature=0,
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,
max_iterations=20000,
plain_alphabet=None,
cipher_alphabet=None,
- fitness=P
letter
s, chunksize=1):
+ fitness=P
trigram
s, chunksize=1):
worker_args = []
ciphertext = sanitise(message)
for i in range(workers):
worker_args = []
ciphertext = sanitise(message)
for i in range(workers):