Last active
March 29, 2018 04:50
-
-
Save kiriappeee/b3dbdcdea243bafee8504e9304a9b638 to your computer and use it in GitHub Desktop.
Learning encryption
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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