ciphers.affine_cipher

Attributes

SYMBOLS

Functions

check_keys(→ None)

decrypt_message(→ str)

encrypt_message(→ str)

get_random_key(→ int)

main(→ None)

Module Contents

ciphers.affine_cipher.check_keys(key_a: int, key_b: int, mode: str) None
ciphers.affine_cipher.decrypt_message(key: int, message: str) str
>>> decrypt_message(4545, 'VL}p MM{I}p~{HL}Gp{vp pFsH}pxMpyxIx JHL O}F{~pvuOvF{FuF'
...                       '{xIp~{HL}Gi')
'The affine cipher is a type of monoalphabetic substitution cipher.'
ciphers.affine_cipher.encrypt_message(key: int, message: str) str
>>> encrypt_message(4545, 'The affine cipher is a type of monoalphabetic '
...                       'substitution cipher.')
'VL}p MM{I}p~{HL}Gp{vp pFsH}pxMpyxIx JHL O}F{~pvuOvF{FuF{xIp~{HL}Gi'
ciphers.affine_cipher.get_random_key() int
ciphers.affine_cipher.main() None
>>> key = get_random_key()
>>> msg = "This is a test!"
>>> decrypt_message(key, encrypt_message(key, msg)) == msg
True
ciphers.affine_cipher.SYMBOLS = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'