Skip to content

Instantly share code, notes, and snippets.

@smellslikeml
Created October 21, 2018 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smellslikeml/e5a75dda5326781fa7b2b9cee5886824 to your computer and use it in GitHub Desktop.
Save smellslikeml/e5a75dda5326781fa7b2b9cee5886824 to your computer and use it in GitHub Desktop.
Generate RSA keys
#!/usr/bin/env python
from Crypto.PublicKey import RSA
new_key = RSA.generate(2048, e=65537)
public_key = new_key.publickey().exportKey('PEM')
private_key = new_key.exportKey('PEM')
print(public_key)
print(private_key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment