1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

simple keygen script

This commit is contained in:
Jeff 2022-06-26 10:02:23 -04:00
parent a9a9593128
commit a3725284e4
No known key found for this signature in database
GPG key ID: 025C02EE3A092F2D

26
contrib/keygen.py Executable file
View file

@ -0,0 +1,26 @@
#!/usr/bin/env python3
#
# .loki secret key generator script
# makes keyfile contents
#
# usage: python3 keygen.py out.private
# python3 keygen.py > /some/where/over/the/rainbow
#
from nacl.bindings import crypto_sign_keypair
import sys
out = sys.stdout
close_out = lambda : None
args = sys.argv[1:]
if args and args[0] != '-':
out = open(args[0], 'wb')
close_out = out.close
pk, sk = crypto_sign_keypair()
out.write(b'64:')
out.write(sk)
out.flush()
close_out()