porta (version 1.3, 18 March 2001)
index
../porta.py

porta.py - porta classical cipher for python.
 
Requires cipher.py by Tesla Coil <tescoil@irtc.net>
and (currently) ecipher.py by me.
 
Not the most brilliant version, but one that works and
is simple to understand.
 
Porta enciphers/deciphers inversely.

 
Modules
            
cipher
ecipher
string

 
Functions
            
doenc(key, plaintext)
 encryption/decryption driver for porta
portaenc(key, plaintext)
Encipherment:
 
make bigrams of the repeated key and text, then for
each bigram, test which half of the alphabet they fall into;
then look up the dictionary, indexing for either the first
or second letter of the bigram in either the dictionary value
or the first half of the alphabet. Uses running-key ONLY.
 
Returns a list of the ciphertext.

 
Data
             __author__ = 'Sean Dwyer <ewe2@can.org.au>'
__credits__ = 'Tesla Coil for cipher.py, sci.crypt for insight,\012and everyone on the Tutor mailing list for help!\012'
__date__ = '18 March 2001'
__file__ = './porta.py'
__name__ = 'porta'
__version__ = '$Revision: 1.6 $'
pdict = {'A': ['N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'], 'B': ['N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'], 'C': ['O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'N'], 'D': ['O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'N'], 'E': ['P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'N', 'O'], 'F': ['P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'N', 'O'], 'G': ['Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'N', 'O', 'P'], 'H': ['Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'N', 'O', 'P'], 'I': ['R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'N', 'O', 'P', 'Q'], 'J': ['R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'N', 'O', 'P', 'Q'], ...}

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

 
Credits
             Tesla Coil for cipher.py, sci.crypt for insight,
and everyone on the Tutor mailing list for help!