CrackingCodes.Ch07 package

Submodules

CrackingCodes.Ch07.addNumbers module

Addition function

Contains a function that adds two numbers.

CrackingCodes.Ch07.addNumbers.addNumbers(a: int, b: int) → int[source]

Adds two numbers.

Performs addition operation to two numbers.

Parameters:
  • a – Input to add to
  • b – Input to be added
Returns:

Result of addition of two inputs.

CrackingCodes.Ch07.addNumbers.main()[source]

CrackingCodes.Ch07.helloFunction module

Hello function.

Contains function that prints hello to given name.

CrackingCodes.Ch07.helloFunction.hello(name: str) → None[source]

Prints hello.

Prints hello to given name.

Parameters:name – Name to say hello to.
Returns:Prints hello to given name.
CrackingCodes.Ch07.helloFunction.main()[source]

CrackingCodes.Ch07.transpositionEncrypt module

Transposition Cipher Encryption

Demonstrates how to implement a transposition cipher.

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'
CrackingCodes.Ch07.transpositionEncrypt.main()[source]

Module contents