Skip to content

Instantly share code, notes, and snippets.

@vikramacharya
Last active August 23, 2022 16:09
Show Gist options
  • Save vikramacharya/4d49457e6dd82e6770bb5101f66bae2e to your computer and use it in GitHub Desktop.
Save vikramacharya/4d49457e6dd82e6770bb5101f66bae2e to your computer and use it in GitHub Desktop.
Generate Key Pair using nacl
import base64
from nacl.signing import SigningKey, VerifyKey
def generate_key_pairs():
signing_key = SigningKey.generate()
private_key = base64.b64encode(signing_key._signing_key).decode()
public_key = base64.b64encode(bytes(signing_key.verify_key)).decode()
return private_key, public_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment