Skip to content

Instantly share code, notes, and snippets.

@kiriappeee
Last active March 29, 2018 04:50
Show Gist options
  • Save kiriappeee/b3dbdcdea243bafee8504e9304a9b638 to your computer and use it in GitHub Desktop.
Save kiriappeee/b3dbdcdea243bafee8504e9304a9b638 to your computer and use it in GitHub Desktop.
Learning encryption
from Crypto.PublicKey import RSA
key=RSA.generate(2048)
privateKey=key.publickey().exportKey(format='PEM')
f=open('encryption.pem.pub', 'wb')
f.write(privateKey)
f.close()
publicKey=key.exportKey(format='PEM')
f=open('encryption.pem', 'wb')
f.write(publicKey)
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment