autokey (version 1.4, 20 March 2001)
index
../autokey.py

autokey.py - basic vigenere-based autokey cipher for python.
 
Requires cipher.py by Tesla Coil <tescoil@irtc.net>
and (currently) ecipher.py by me.
 
Auto-key ciphers need a basic key to provide a useful period;
the rest of the message is usually enciphered by starting again
from the beginning of the plaintext.
 
This approach can be extended for other polyalphabetic ciphers
like beaufort, and variant beaufort.
 
TODO: get gronsfeld working with alphabetical key.

 
Modules
            
cipher
ecipher
string

 
Functions
            
autodec(type, key, plaintext)
Decryption:
 
We get the list of bigrams plus any nulls. Split
the bigrams back into key and plaintext, decrypt the
first keylength letters, and use that group to decrypt
the next, and so on.
 
Currently uses beaufort, vigenere or varbeau
autoenc(type, key, plaintext)
Encryption:
 
Choose one of vigenere, varbeau or beaufort to encipher.
Runs through the autokey bigram list and calls the
desired encryption algorithm.
autoencdec(type, dir, key, plaintext)
Encryption/decryption driver for autokey

 
Data
             __author__ = 'Sean Dwyer <ewe2@can.org.au>'
__credits__ = 'cipher.py by Tesla Coil <tescoil@irtc.net>'
__date__ = '20 March 2001'
__file__ = './autokey.py'
__name__ = 'autokey'
__version__ = '$Revision: 1.5 $'

 
Author
             Sean Dwyer <ewe2@can.org.au>

 
Credits
             cipher.py by Tesla Coil <tescoil@irtc.net>