Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bash script to encrypt and decrypt files using 'openssl'
# Install it in .bashrc file
function encrypt(){
which openssl &> /dev/null
[ $? -ne 0 ] && echo "OPENSSL is not installed." && return 1
openssl enc -aes-256-cbc -salt -in $1 -out $2
}
function decrypt(){
which openssl &> /dev/null
[ $? -ne 0 ] && echo "OPENSSL is not installed." && return 1
openssl enc -aes-256-cbc -d -in $1 -out $2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment