From 5c22526225994d0ffda69774d38c503ac9ea5ffb Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Thu, 3 Feb 2011 14:53:29 +0000 Subject: add config file and script to split passphrase using ssss-split --- config | 16 ++++++++++++++++ generate-key.sh | 10 +--------- split-passphrase | 21 +++++++++++++++++++++ 3 files changed, 38 insertions(+), 9 deletions(-) create mode 100644 config create mode 100755 split-passphrase diff --git a/config b/config new file mode 100644 index 0000000..d8b7c44 --- /dev/null +++ b/config @@ -0,0 +1,16 @@ +GPGHOMEDIR="./homedir" +PUBDIR="./public" +PRIVDIR="./private" +INPUTDIR="./input" + +pubkey="$PUBDIR/mageia-board-pubkey.gpg" +seckey="$PRIVDIR/mageia-board-seckey" +seckey_e="$PRIVDIR/mageia-board-seckey.gpg" +passphrase="$PRIVDIR/passphrase" + +ssplit="./bin/ssss-split" +scombine="./bin/sss-combine" +partsdir="$PRIVDIR/parts" +nb_threshold=3 +nb_shares=6 + diff --git a/generate-key.sh b/generate-key.sh index 51ec8e1..d41a90c 100755 --- a/generate-key.sh +++ b/generate-key.sh @@ -1,14 +1,6 @@ #!/bin/sh -GPGHOMEDIR="./homedir" -PUBDIR="./public" -PRIVDIR="./private" -INPUTDIR="./input" - -pubkey="$PUBDIR/mageia-board-pubkey.gpg" -seckey="$PRIVDIR/mageia-board-seckey" -seckey_e="$PRIVDIR/mageia-board-seckey.gpg" -passphrase="$PRIVDIR/passphrase" +. ./config echo 'Today is :' date diff --git a/split-passphrase b/split-passphrase new file mode 100755 index 0000000..701e4ae --- /dev/null +++ b/split-passphrase @@ -0,0 +1,21 @@ +#!/bin/sh + +. ./config + +ssplit="./bin/ssss-split" +scombine="./bin/sss-combine" +partsdir="$PRIVDIR/parts" +nb_threshold=3 +nb_shares=6 + +mkdir -p "$partsdir" + +$ssplit -x -t $nb_threshold -n $nb_shares < "$passphrase" > "$partsdir/all" + +for num in `seq 1 $nb_shares` +do + grep "^$num-" "$partsdir/all" > "$partsdir/$num" +done + +rm -f "$partsdir/all" + -- cgit v1.2.1