From 258f62af22f141b0eaf104d0023ba11f59d19974 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sat, 7 Dec 2013 19:48:02 +0100 Subject: [PATCH] Add key generation script --- ccollectd/genkey | 15 +++++++++++++++ cstatsd/genkey | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 ccollectd/genkey create mode 100755 cstatsd/genkey diff --git a/ccollectd/genkey b/ccollectd/genkey new file mode 100755 index 0000000..e62e024 --- /dev/null +++ b/ccollectd/genkey @@ -0,0 +1,15 @@ +#!/usr/bin/env python2 + +import yaml, os, stat, binascii +from nacl.public import PrivateKey + +privkey = PrivateKey.generate() +pubkey = privkey.public_key + +with open("privkey.dat", "w") as f: + f.write(binascii.hexlify(str(privkey))) + +with open("pubkey.dat", "w") as f: + f.write(binascii.hexlify(str(pubkey))) + +os.chmod("privkey.dat", stat.S_IRUSR | stat.S_IWUSR) diff --git a/cstatsd/genkey b/cstatsd/genkey new file mode 100755 index 0000000..e62e024 --- /dev/null +++ b/cstatsd/genkey @@ -0,0 +1,15 @@ +#!/usr/bin/env python2 + +import yaml, os, stat, binascii +from nacl.public import PrivateKey + +privkey = PrivateKey.generate() +pubkey = privkey.public_key + +with open("privkey.dat", "w") as f: + f.write(binascii.hexlify(str(privkey))) + +with open("pubkey.dat", "w") as f: + f.write(binascii.hexlify(str(pubkey))) + +os.chmod("privkey.dat", stat.S_IRUSR | stat.S_IWUSR)