#
# the custom version shown in the text simply adds 1 to each:
# >>> from secret import *
# >>> x = do_encode('abc123')
# >>> x
# 'bcd234'
# >>> do_decode(x)
# 'abc123'
#
# adding stingification to avoid special character issues:
# >>> x = do_encode('spam')
# >>> x
# '* _\344'
# >>> do_decode(x)
# 'spam'
#
# >>> x = stringify('spam')
# >>> x
# '-115-112-97-109'
# >>> unstringify(x)
# 'spam'
#
# >>> x = encode('spam')
# >>> x
# '-42-32-95-228'
# >>> decode(x)
# 'spam'
# 
# >>> x = encode('abc1@#<>&+')
# >>> x
# '-32-211-97-110-77-154-37-240-10-54'
# >>> decode(x)
# 'abc1@#<>&+'
#
# after changing to use the non-rotor encoder here:
# >>> reload(secret)
# <module 'secret' from 'secret.py'>
# >>> from secret import *
# >>> x= encode('abc1@#<>&+')
# >>> x
# '-98-99-100-50-65-36-61-63-39-44'
# >>> decode(x)
# 'abc1@#<>&+'
#
# also employs the rotor encryption module in the standard
# Python library, as an alternative (by day of the week);
# rotor is an enigma-like system that does a fairly good 
# encryption job; see the library manual for more details:
#
# >>> import rotor
# >>> r = rotor.newrotor('pymailcgi')   # (key [,numrotors])
# >>> r.encrypt('abc123')
# ' \323an\021\224'
# >>> x = r.encrypt('spam123')          # result is same len
# >>> x
# '* _\344\011pY'
# >>> r.decrypt(x)
# 'spam123'
# 
# C:\...>python
# >>> import rotor
# >>> r = rotor.newrotor('pymailcgi')
# >>> r.decrypt('* _\344\011pY')
# 'spam123'
