CrackingCodes.Ch13 package

Submodules

CrackingCodes.Ch13.PracticeQuestions module

Chapter 13 Practice Questions

Answers Chapter 13 Practice Questions via Python code.

CrackingCodes.Ch13.PracticeQuestions.main()[source]

CrackingCodes.Ch13.cryptomath module

Cryptomath Module

Provides mathematical functions for use in cryptography. (Discrete mathematics FTW!)

CrackingCodes.Ch13.cryptomath.findModInverse(a: int, m: int)[source]

Modular inverse

Returns modular inverse of given inputs using Euclid’s extended algorithm.

Parameters:
  • a – First integer input.
  • m – Second integer input.
Returns:

Modular inverse as an integer if it exists, None otherwise.

CrackingCodes.Ch13.cryptomath.gcd(a: int, b: int) → int[source]

Greatest common divisor

Returns greatest common divisor of given inputs using Euclid’s algorithm.

Parameters:
  • a – First integer input.
  • b – Second integer input.
Returns:

Integer representing GCD.

Module contents