ecipher (version 1.6, 21 March 2001)
index
../ecipher.py

ecipher.py - useful functions for classical cryptography.
 
This module is my adjunct to cipher.py by Tesla Coil
<tescoil@irtc.net> for the ciphers I added. Some are specific
to polyalphabetic ciphers, some are generalized for classical
cryptographic needs, like nulls.

 
Modules
            
cipher
string
whrandom

 
Functions
            
autokey(key, plaintext)
Standard autokey using keyword as initial period
and the plaintext as remaining key. Gronsfeld doesn't
work with this yet, and decipherment is incomplete with
the vigenere family of ciphers.
 
Requires that key is a list.
beaucrypt(a, b)
beaufort encryption/decryption
bigrams(text)
Returns alphabetic bigrams from the plaintext.
makedict(keylist, coords)
Returns a dictionary of each keyletter's keysquare
coordinates. Very handy for playfair.
makeldict(keylist, coords)
Returns list of keyletters and their corresponding
keysquare coordinates
nullinsert(text)
Insert nulls from a random list to plaintext for encryption
to make up 5-letter groups.
numgram(text)
Returns numeric bigrams of the plaintext.
pcoords(keysquare, text)
Search keysquare for letters in text and return list of
coordinates.This differs from tesla's function for use
with a dictionary.
repkey(key, plaintext)
Returns the repeated key to the length of the plaintext.
A must for periodic ciphers.
vbigrams(type, key, plaintext)
Return bigrams from key and text together so we can
encipher them. For some ciphers, the order of bigrams is
important! Choice of running key or autokey.
vigcrypt(a, b)
vigenere encryption, variant beaufort decryption
vigdecrypt(a, b)
vigenere decryption, variant beaufort encryption

 
Data
             __author__ = 'Sean Dwyer <ewe2@can.org.au>'
__credits__ = 'cipher.py by Tesla Coil <tescoil@irtc.net>.\012Doug...UG@oceanic.net> for the keyword repetition code.\012'
__date__ = '21 March 2001'
__file__ = './ecipher.pyc'
__name__ = 'ecipher'
__version__ = '$Revision: 1.7 $'

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

 
Credits
             cipher.py by Tesla Coil <tescoil@irtc.net>.
Doug Stanfield <DOUG@oceanic.net> for the keyword repetition code.