aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config16
-rwxr-xr-xgenerate-key.sh10
-rwxr-xr-xsplit-passphrase21
3 files changed, 38 insertions, 9 deletions
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"
+