projects
/
szyfrow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Started on documentation
[szyfrow.git]
/
szyfrow
/
autokey.py
diff --git
a/szyfrow/autokey.py
b/szyfrow/autokey.py
index 36ffa856b49ad45d987af125c5bcde468aeae8da..b9e2184275c6a68e898ce42f5b0fa625bd362af8 100644
(file)
--- a/
szyfrow/autokey.py
+++ b/
szyfrow/autokey.py
@@
-1,3
+1,6
@@
+"""Enciphering and deciphering using the [Autokey cipher](https://en.wikipedia.org/wiki/Autokey_cipher).
+Also attempts to break messages that use a Autokey cipher.
+"""
import math
import multiprocessing
from szyfrow.support.utilities import *
import math
import multiprocessing
from szyfrow.support.utilities import *
@@
-30,7
+33,6
@@
def autokey_decipher(ciphertext, keyword):
return cat(plaintext)
return cat(plaintext)
-
def autokey_sa_break( message
, min_keylength=2
, max_keylength=20
def autokey_sa_break( message
, min_keylength=2
, max_keylength=20
@@
-61,10
+63,8
@@
def autokey_sa_break( message
def autokey_sa_break_worker(message, key,
def autokey_sa_break_worker(message, key,
- t0, max_iterations, fitness):
-
+ t0, max_iterations, fitness):
temperature = t0
temperature = t0
-
dt = t0 / (0.9 * max_iterations)
plaintext = autokey_decipher(message, key)
dt = t0 / (0.9 * max_iterations)
plaintext = autokey_decipher(message, key)