forked from oxen-io/lokinet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9a9593
commit a372528
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
|