Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- key = RSA.generate(4096)
- with open("/root/Desktop/private.pem", 'w') as content_file:
- content_file.write(key.exportKey('PEM'))
- pubkey = key.publickey()
- with open("/root/Desktop/PubKey_E27.pem", 'w') as content_file:
- content_file.write(pubkey.exportKey('PEM'))
- private_key=crypto.load_privatekey(crypto.FILETYPE_PEM,open("/root/Desktop/private.pem","rb").read())
- private_key.from_cryptography_key(private_key)
- public_key=crypto.load_publickey(crypto.FILETYPE_PEM,open("/root/Desktop/PubKey_E27.pem","rb").read())
- public_key.from_cryptography_key(public_key)
Add Comment
Please, Sign In to add comment