Cryptography, Cybersecurity, Tls, Rsa.
p_rec=libnum.gcd(pow(s,e,N)-m,N) q_rec = N//p_rec print("s1 (no error): ",s1) print("s2 (error): ",s2) print("s (error): ",s) print("p recovered: ",p_rec) print("q recovered: ",q_rec) if (p==p_rec): print("!!! Successfully recovered p !!!") if (q==q_rec): print("!!! Successfully recovered q !!!")