Revisions

gist: 162786 Download_button fork
public
Public Clone URL: git://gist.github.com/162786.git
Embed All Files: show embed
decrypt.sh #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/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
encrypt.sh #
1
2
3
4
5
6
7
8
9
#!/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"