def gcd(e, z): if z == 0: return e else: return gcd(z, e % z) e = int(input("Please enter the first number:")) z = int(input("Please enter the second number:")) print ("The GCD of ",e," and ",z," is ",gcd(e,z)) d = 1 while d < e: if d * e == 1 % z: print (d," * ",e," = 1 (mod ",z,")") d = d + 1 else: d = d + 1
I am trying to use this code to search for candidates for rsa using brute force, it seems that it should work, but it can not help me?
z = (p - 1) (q - 1) to calculate z, it is used before with p = 47 and q = 59, e = 17 and d = 157, but after starting the program it does not find matches, but it should.
source share