I want to know where I can find exported keys. I don't see .pem file in my current directory. I am able to save key to txt file but its not working when I am trying to encrypt string using that key. Please help
from Crypto import Random
from Crypto.PublicKey import RSA
def generate_keys():
modulus_length = 256*4
keys = RSA.generate(modulus_length, Random.new().read)
publickey = keys.publickey()
keys.exportKey(format="PEM")
publickey.exportKey(format="PEM")
# with open("prkey","wb") as f:
# f.write(keys.exportKey())
# with open("pvkey","wb") as p:
# p.write(publickey.exportKey())
return keys, publickey