from Crypto.PublicKey import RSA from Crypto.PublicKey import ECC #Task 1 install pycryptodome package rsa_priv = RSA.importKey(open('RSApriv.pem').read()) print(rsa_priv.p, rsa_priv.q, rsa_priv.d, sep='\n') #Task 1 - Show that p*q = modulus print("\nTask 1") #Task 2 - encrypt ptx to ctx and decrypt to decrypted print("\nTask 2") ptx = 10 ctx = ptx decrypted = ptx print(decrypted) #Task 3 - Show that P+P = 2*P ec_pub = ECC.import_key(open('ECpub.pem').read()) print(ec_pub.pointQ.xy)