ciphers.porta_cipher ==================== .. py:module:: ciphers.porta_cipher Attributes ---------- .. autoapisummary:: ciphers.porta_cipher.alphabet ciphers.porta_cipher.key Functions --------- .. autoapisummary:: ciphers.porta_cipher.decrypt ciphers.porta_cipher.encrypt ciphers.porta_cipher.generate_table ciphers.porta_cipher.get_opponent ciphers.porta_cipher.get_position Module Contents --------------- .. py:function:: decrypt(key: str, words: str) -> str >>> decrypt('marvin', 'QRACRWU') 'JESSICA' .. py:function:: encrypt(key: str, words: str) -> str >>> encrypt('marvin', 'jessica') 'QRACRWU' .. py:function:: generate_table(key: str) -> list[tuple[str, str]] >>> generate_table('marvin') # doctest: +NORMALIZE_WHITESPACE [('ABCDEFGHIJKLM', 'UVWXYZNOPQRST'), ('ABCDEFGHIJKLM', 'NOPQRSTUVWXYZ'), ('ABCDEFGHIJKLM', 'STUVWXYZNOPQR'), ('ABCDEFGHIJKLM', 'QRSTUVWXYZNOP'), ('ABCDEFGHIJKLM', 'WXYZNOPQRSTUV'), ('ABCDEFGHIJKLM', 'UVWXYZNOPQRST')] .. py:function:: get_opponent(table: tuple[str, str], char: str) -> str >>> get_opponent(generate_table('marvin')[0], 'M') 'T' .. py:function:: get_position(table: tuple[str, str], char: str) -> tuple[int, int] >>> get_position(generate_table('marvin')[0], 'M') (0, 12) .. py:data:: alphabet .. py:data:: key