]> git.scottworley.com Git - overonion/commitdiff
Double overonion
authorScott Worley <scottworley@scottworley.com>
Fri, 20 Oct 2017 07:50:06 +0000 (00:50 -0700)
committerScott Worley <scottworley@scottworley.com>
Fri, 20 Oct 2017 08:22:29 +0000 (01:22 -0700)
double-overonion [new file with mode: 0755]

diff --git a/double-overonion b/double-overonion
new file mode 100755 (executable)
index 0000000..afd4ebb
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+if (( $# != 3));then
+  echo "usage: double-overonion e|d keyfile1 keyfile2"
+  exit 1
+fi
+mode=$1
+if [[ "$mode" != e && "$mode" != d ]];then
+  echo "Use 'e' for encrypt or 'd' for decrypt"
+  exit 1
+fi
+keyfile1=$2
+keyfile2=$3
+
+function oo() {
+  "$(dirname "$0")/overonion" "$mode" "$@"
+}
+
+if [[ "$mode" == e ]];then
+  oo "$keyfile2" | reverse | oo "$keyfile1"
+else
+  oo "$keyfile1" | reverse | oo "$keyfile2"
+fi