Skip to content

Instantly share code, notes, and snippets.

@fernandotakai
Created August 5, 2009 16:14
Show Gist options
  • Save fernandotakai/162786 to your computer and use it in GitHub Desktop.
Save fernandotakai/162786 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ "$1" == "" ]; then
echo "decrypt file"
exit 1
fi
openssl aes-256-cbc -d -in "$1" -out "$1_dec" 2> /dev/null
if [ "$?" == "0" ]; then
echo "Decrypting..."
rm -fr "$1"
mv "$1_dec" "$1"
fi
#!/bin/sh
if [ "$1" == "" ]; then
echo "encrypt file"
exit 1
fi
openssl aes-256-cbc -salt -in "$1" -out "$1_enc"
mv "$1_enc" "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment