summaryrefslogtreecommitdiff
path: root/attic
diff options
context:
space:
mode:
Diffstat (limited to 'attic')
-rw-r--r--attic/README.md6
-rw-r--r--attic/README.txt2
-rwxr-xr-xattic/decrypt32
-rwxr-xr-xattic/encrypt32
4 files changed, 70 insertions, 2 deletions
diff --git a/attic/README.md b/attic/README.md
new file mode 100644
index 00000000..4f1cd330
--- /dev/null
+++ b/attic/README.md
@@ -0,0 +1,6 @@
+This directory is for old code that isn't used but we don't want to lose track of, and for anything else random like debug scripts.
+
+Some stuff other than shelved code:
+
+multicast-trace-receiver.rb: receives multicast trace UDP packets from ZT_TRACE_MULTICAST
+encrypt, decrypt: useful shell scripts for AES-encrypting and decrypting files
diff --git a/attic/README.txt b/attic/README.txt
deleted file mode 100644
index 65cd9e91..00000000
--- a/attic/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This directory is for old code that isn't used but we don't want to lose
-track of, and for anything else random like debug scripts.
diff --git a/attic/decrypt b/attic/decrypt
new file mode 100755
index 00000000..5af3acd4
--- /dev/null
+++ b/attic/decrypt
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+export PATH=/bin:/usr/bin
+
+if [ ! -e /usr/bin/openssl ]; then
+ echo $0: requires /usr/bin/openssl, please install openssl tools
+ exit 1
+fi
+
+if [ "$#" -lt 1 ]; then
+ echo $0: Usage: $0 '<input>' '[output]'
+ exit 1
+fi
+
+if [ ! -r "$1" ]; then
+ echo $0: $1 does not exist or is not readable.
+ exit 1
+fi
+
+outpath=`echo "$1" | sed 's/[.]aes$//'`
+if [ "$#" -ge 2 ]; then
+ outpath="$2"
+fi
+
+if [ -f "$outpath" ]; then
+ echo $0: $outpath already exists, delete or rename first.
+ exit 1
+fi
+
+openssl aes-256-cbc -d -salt -in "$1" -out "$outpath"
+
+echo $0: wrote "$outpath"
diff --git a/attic/encrypt b/attic/encrypt
new file mode 100755
index 00000000..243a46d7
--- /dev/null
+++ b/attic/encrypt
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+export PATH=/bin:/usr/bin
+
+if [ ! -e /usr/bin/openssl ]; then
+ echo $0: requires /usr/bin/openssl, please install openssl tools
+ exit 1
+fi
+
+if [ "$#" -lt 1 ]; then
+ echo $0: Usage: $0 '<input>' '[output]'
+ exit 1
+fi
+
+if [ ! -r "$1" ]; then
+ echo $0: $1 does not exist or is not readable.
+ exit 1
+fi
+
+outpath="$1.aes"
+if [ "$#" -ge 2 ]; then
+ outpath="$2"
+fi
+
+if [ -f "$outpath" ]; then
+ echo $0: $outpath already exists, delete or rename first.
+ exit 1
+fi
+
+openssl aes-256-cbc -salt -in "$1" -out "$outpath"
+
+echo $0: wrote "$outpath"