Skip to content

Commit

Permalink
simple keygen script
Browse files Browse the repository at this point in the history
  • Loading branch information
majestrate committed Jun 26, 2022
1 parent a9a9593 commit a372528
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions contrib/keygen.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit a372528

Please sign in to comment.