cipher
index
../cipher.py

# cipher.py - Classical Cryptography Functions.
# Version 0.0.01 
#
# Unrestricted Submarine Warfare License.
# 2001, Tesla Coil <tescoil@irtc.net> 
# -- TNX to Sean Dwyer <ewe2@can.org.au>
# without whom, I might have left it alone.
#
# Expects list input in uppercase letters, e.g.,  
#
# import string, cipher
# key = raw_input('keyword please: ') 
# key = list(string.upper(key))
# cipher.unstray(key)
#
#

 
Functions
            
coltrans(keyseq, plaintext)
 Handles plaintext as if written in margins
of keyseq length, reading down columns 
following numeric order provided by same.
Returns new list.
getcoords(keysquare, text)
 Search keysquare for letters in text
and return list of coordinates
horizkeysquare(keyalphalist)
 Returns a 5x5 or 6x6 square (list of lists)
input alphabet list reading horizontally.
keyalphabet(keylist, opt=None)
 Places keyword at beginning of alphabet 
and removes duplicate letters. Returns new list.
keysequence(keylist)
 Returns numeric sequence based on alphabetic
order of letters in the keylist.
prepkeysquare(keyalphalist)
 Removes the letter 'J' for reduction to a
25 letter alphabet. Deprecated.
prepkeysquaretext(plaintext)
 Replaces all occurences of 'J' in list
with 'I'. Used with 5x5 keysquare ciphers. 
Destructive operation on input.
rmdupes(listinput)
 Removes duplicates from list that follow
first occurences.  Returns new list.
Used in keyalphabet function.  Separated
for possible use in something completely
different.
telegraph(result)
 Print results to stdout in five letter groups.
unstray(listinput, opt=None)
 Removes all but uppercase letters.
opt = '6x6' retains numerals.
Destructive operation on input.
vertkeysquare(keyalphalist)
 Returns a 5x5 or 6x6 square (list of lists)
input alphabet list reading vertically.

 
Data
             __file__ = './cipher.py'
__name__ = 'cipher'
digits = '0123456789'
uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
upperlist = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', ...]