Code: Select all
tar -cvf - /home | aescrypt -e -k secret.key - >backup_files.tar.aes
Code: Select all
aescrypt_keygen -p apples secret.key
Code: Select all
aescrypt_keygen -g 65 secret.key
Code: Select all
tar -cvf - /home | aescrypt -e -k secret.key - >backup_files.tar.aes
Code: Select all
aescrypt_keygen -p apples secret.key
Code: Select all
aescrypt_keygen -g 65 secret.key
Code: Select all
#/bin/bash
#
# encrypt
#
# Encrypt a file using AES Crypt and a key file that is protected
# with a passphrase. If successful, the error code returned will
# be 0. Any non-zero error code indicates an error.
#
# Usage: encrypt <key file> <password> <file> [ <file> ... ]
#
if [ $# -lt 3 ] ; then
echo "usage: encrypt <key file> <password> <file> [ <file> ... ]"
exit 255
fi
# Get the key file and password from the command-line
KEYFILE=$1; shift
PASSWORD=$1; shift
PLAINTEXTKEYFILE=$KEYFILE.$$
# Set a trap to ensure we clean up
trap "{ if [ -f $PLAINTEXTKEYFILE ] ; then echo Removing plaintext key file; rm -f $PLAINTEXTKEYFILE; fi; }" EXIT
# Decrypt the key file
echo Attemping to decrypt key file
aescrypt -d -p "$PASSWORD" -o "$PLAINTEXTKEYFILE" $KEYFILE || exit
# Encrypt the target files(s)
echo Encrypting target file(s)
aescrypt -e -k $PLAINTEXTKEYFILE $*
Code: Select all
encrypt mykey.key.aes apple foo.txt