Last active
August 23, 2022 16:09
-
-
Save vikramacharya/4d49457e6dd82e6770bb5101f66bae2e to your computer and use it in GitHub Desktop.
Generate Key Pair using nacl
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
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