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
1 changed files with 26 additions and 0 deletions

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()