Mercurial > public > m209
view examples/encrypt.py @ 69:2173ac4c2d9b
Adjust TOC depth. Add link to StdProcedure from M209 description.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 21 Jul 2013 14:07:20 -0500 |
parents | 9341896b93f0 |
children |
line wrap: on
line source
"""Example of how to perform an encrypt operation using the standard procedure. Assumes a key file named m209keys.cfg exists in the current directory and contains the key list with indicator MB. """ from m209.procedure import StdProcedure from m209.keylist.config import read_key_list key_list = read_key_list('m209keys.cfg', 'MB') if key_list: proc = StdProcedure(key_list=key_list) plaintext = "THE PIZZA HAS ARRIVED STOP NO SIGN OF ENEMY FORCES STOP" msg = proc.encrypt(plaintext, spaces=True, ext_msg_ind='PDUFHL', sys_ind='I') print(msg) else: print("Key list MB not found")