Skip to content

Instantly share code, notes, and snippets.

@rhelmer
Created June 19, 2018 21:28
Show Gist options
  • Select an option

  • Save rhelmer/3331ca166bcc9ee05c21a1834fa58cea to your computer and use it in GitHub Desktop.

Select an option

Save rhelmer/3331ca166bcc9ee05c21a1834fa58cea to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
#
# Simple script to generate a CURVE25519 keypair.
# brew install libsodium && pip install pysodium
import pysodium
keypair = pysodium.crypto_box_keypair()
toHex = lambda x: "".join("{:02X}".format(ord(c)) for c in x)
print "Public key", toHex(keypair[0])
print "Secret key", toHex(keypair[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment