CrackingCodes.Ch07 package¶
Subpackages¶
Submodules¶
CrackingCodes.Ch07.addNumbers module¶
Addition function
Contains a function that adds two numbers.
CrackingCodes.Ch07.helloFunction module¶
Hello function.
Contains function that prints hello to given name.
CrackingCodes.Ch07.transpositionEncrypt module¶
Transposition Cipher Encryption
Demonstrates how to implement a transposition cipher.
Note
https://www.nostarch.com/crackingcodes/ (BSD Licensed)
-
CrackingCodes.Ch07.transpositionEncrypt.
encryptMessage
(key: int, message: str) → str[source]¶ Transposition Cipher Encrypt
Encrypts given message using a transposition cipher with given key.
Parameters: - key – Numeric key to encrypt with.
- message – Message to encrypt.
Returns: Message encrypted in a string.
Example
>>> encryptMessage(9, 'Underneath a huge oak tree there was of swine a huge company,') 'Uhot on ahoamdakef pe r harhtesunnur wgyegewie,aeean t sec'