#TSGCTF_2021 from Crypto.Util.number import isPrime from random import randrange from secret import p, q, L, e, d class RSA: def __init__(self, p, q, L, e, d): assert(isPrime(p) and isPrime(q)) self.N = p * q self.L = L self.e = e self.d = d # these are the normal RSA conditions for _ in range(100):…