ciphers.fractionated_morse_cipher ================================= .. py:module:: ciphers.fractionated_morse_cipher .. autoapi-nested-parse:: Python program for the Fractionated Morse Cipher. The Fractionated Morse cipher first converts the plaintext to Morse code, then enciphers fixed-size blocks of Morse code back to letters. This procedure means plaintext letters are mixed into the ciphertext letters, making it more secure than substitution ciphers. http://practicalcryptography.com/ciphers/fractionated-morse-cipher/ Attributes ---------- .. autoapisummary:: ciphers.fractionated_morse_cipher.MORSE_CODE_DICT ciphers.fractionated_morse_cipher.MORSE_COMBINATIONS ciphers.fractionated_morse_cipher.REVERSE_DICT ciphers.fractionated_morse_cipher.plaintext Functions --------- .. autoapisummary:: ciphers.fractionated_morse_cipher.decrypt_fractionated_morse ciphers.fractionated_morse_cipher.encode_to_morse ciphers.fractionated_morse_cipher.encrypt_fractionated_morse Module Contents --------------- .. py:function:: decrypt_fractionated_morse(ciphertext: str, key: str) -> str Decrypt a ciphertext message encrypted with Fractionated Morse Cipher. Args: ciphertext: The ciphertext message to decrypt. key: The decryption key. Returns: The decrypted plaintext message. Example: >>> decrypt_fractionated_morse("ESOAVVLJRSSTRX","Roundtable") 'DEFEND THE EAST' .. py:function:: encode_to_morse(plaintext: str) -> str Encode a plaintext message into Morse code. Args: plaintext: The plaintext message to encode. Returns: The Morse code representation of the plaintext message. Example: >>> encode_to_morse("defend the east") '-..x.x..-.x.x-.x-..xx-x....x.xx.x.-x...x-' .. py:function:: encrypt_fractionated_morse(plaintext: str, key: str) -> str Encrypt a plaintext message using Fractionated Morse Cipher. Args: plaintext: The plaintext message to encrypt. key: The encryption key. Returns: The encrypted ciphertext. Example: >>> encrypt_fractionated_morse("defend the east","Roundtable") 'ESOAVVLJRSSTRX' .. py:data:: MORSE_CODE_DICT .. py:data:: MORSE_COMBINATIONS :value: ['...', '..-', '..x', '.-.', '.--', '.-x', '.x.', '.x-', '.xx', '-..', '-.-', '-.x', '--.',... .. py:data:: REVERSE_DICT .. py:data:: plaintext :value: 'defend the east'