ciphers.affine_cipher ===================== .. py:module:: ciphers.affine_cipher Attributes ---------- .. autoapisummary:: ciphers.affine_cipher.SYMBOLS Functions --------- .. autoapisummary:: ciphers.affine_cipher.check_keys ciphers.affine_cipher.decrypt_message ciphers.affine_cipher.encrypt_message ciphers.affine_cipher.get_random_key ciphers.affine_cipher.main Module Contents --------------- .. py:function:: check_keys(key_a: int, key_b: int, mode: str) -> None .. py:function:: 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.' .. py:function:: 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' .. py:function:: get_random_key() -> int .. py:function:: main() -> None >>> key = get_random_key() >>> msg = "This is a test!" >>> decrypt_message(key, encrypt_message(key, msg)) == msg True .. py:data:: SYMBOLS :value: ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'