Skip to content

Instantly share code, notes, and snippets.

@izzygomez
Created December 6, 2022 16:16
Show Gist options
  • Save izzygomez/b12a2b0d4abbd98b2e4e6c411c3d76be to your computer and use it in GitHub Desktop.
Save izzygomez/b12a2b0d4abbd98b2e4e6c411c3d76be to your computer and use it in GitHub Desktop.
Python script to generate ed25519 private & public keys
# https://pypi.org/project/PyNaCl/
import nacl
import nacl.signing
import secrets
seed = secrets.token_bytes(32)
# Generate a new random signing key
signing_key = nacl.signing.SigningKey(seed)
# Obtain the hex-encoded signing key
print('Signing key:')
print(signing_key.encode().hex())
# Obtain the hex-encoded verify key for the given signing key
# Use this in the Anchorage Digital Web Dashboard when creating an API key
print('Public key:')
print(signing_key.verify_key.encode().hex())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment