Cryptography, Cybersecurity.
_HasDiscreteLog(value, base, n): b = base % n accumulator = 1 for unused_exponent in range(1, n): if accumulator == value: return True accumulator = (accumulator * b) % n return Falsedef IsWeak(modulus,nprimes): mod_product_of_primes = modulus % product_of_primes_val for i in range(0,nprimes):