From 6f3ba0425a7d3577f4adde66ee66c2460de8690f Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 4 Jan 2010 19:47:59 -0200 Subject: Major design changes --- scripts/decrypt | 17 --------------- scripts/encrypt | 21 ------------------ scripts/genpair | 67 --------------------------------------------------------- scripts/recrypt | 22 ------------------- 4 files changed, 127 deletions(-) delete mode 100755 scripts/decrypt delete mode 100755 scripts/encrypt delete mode 100755 scripts/genpair delete mode 100755 scripts/recrypt (limited to 'scripts') diff --git a/scripts/decrypt b/scripts/decrypt deleted file mode 100755 index 55888ee..0000000 --- a/scripts/decrypt +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# -# Decrypt files. -# - -FILE="$1" -BASENAME="`basename $0`" - -if [ -z "$FILE" ]; then - echo "Usage: `basename $0` " - exit 1 -elif [ ! -f "keys/$FILE" ]; then - echo "File not found" - exit 1 -fi - -gpg -d keys/$FILE diff --git a/scripts/encrypt b/scripts/encrypt deleted file mode 100755 index 23aeaf7..0000000 --- a/scripts/encrypt +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# -# Encrypt files to multiple recipients. -# - -FILE="$1" -BASENAME="`basename $0`" -RECIPIENTS="config/recipients" - -if [ -z "$FILE" ]; then - echo "Usage: `basename $0` " - exit 1 -elif [ ! -f "$RECIPIENTS" ]; then - echo "No recipient config was found" - exit 1 -fi - -mkdir -p keys/`dirname $FILE` -recipients="$(awk '{ print "-r " $2 }' $RECIPIENTS | xargs)" -echo "Type your message and finish your input with EOF (Ctrl-D)." -gpg --armor -e -s $recipients - > keys/$FILE diff --git a/scripts/genpair b/scripts/genpair deleted file mode 100755 index ddbc2fd..0000000 --- a/scripts/genpair +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# Generate keypairs. -# -# This script is just a wrapper to easily generate keys for -# automated systems. -# - -# Generate a keypair, ssh version -function genpair_ssh { - echo "Make sure that $homedir is atop of an encrypted volume." - read -p "Hit ENTER to continue." prompt - - # TODO: programatically enter blank passphrase twice - ssh-keygen -t dsa -f $homedir/id_dsa -C "root@$hostname" - - echo "Now make sure to save this key in a safe location." - echo "You can export it by securely copying $contents to $hostname." -} - -# Generate a keypair, gpg version -function genpair_gpg { - echo "Make sure that $homedir is atop of an encrypted volume." - read -p "Enter password for the private key: " passphrase - - # TODO: insert 279 random bytes - gpg --homedir $homedir --gen-key < " - exit 1 -elif [ -e "$homedir" ]; then - echo "Folder $homedir already exists, leaving" - exit 1 -fi - -# Prepare -mkdir -p $homedir && chmod 700 $homedir -if [ "$?" != "0" ]; then - echo "Error setting up $homedir" - exit 1 -fi - -# Dispatch -genpair_$keytype diff --git a/scripts/recrypt b/scripts/recrypt deleted file mode 100755 index 48c4d40..0000000 --- a/scripts/recrypt +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# Re-encrypt files to multiple recipients. -# - -FILE="$1" -BASENAME="`basename $0`" -RECIPIENTS="config/recipients" - -if [ -z "$FILE" ]; then - echo "Usage: `basename $0` " - exit 1 -elif [ ! -f "$RECIPIENTS" ]; then - echo "No recipient config was found" - exit 1 -elif [ ! -f "keys/$FILE" ]; then - echo "File not found" - exit 1 -fi - -recipients="$(awk '{ print "-r " $2 }' $RECIPIENTS | xargs)" -gpg -d keys/$FILE | gpg --armor -e -s $recipients > keys/$FILE -- cgit v1.2.3