Skip to content

Instantly share code, notes, and snippets.

@olomor
Created May 19, 2020 00:31
Show Gist options
  • Select an option

  • Save olomor/67e846182882150ffbcff09c738ee18f to your computer and use it in GitHub Desktop.

Select an option

Save olomor/67e846182882150ffbcff09c738ee18f to your computer and use it in GitHub Desktop.
A simple "vault" option to store encrypted texts (using openssl lib) on any public document.
sslTextEnc () { sslTextPwd ; read -p "Texto a cryptografar: " TEXT; echo "TEXT" | openssl aes-256-cbc -e -a -iter 2 -pass env:SSLPASS 2>/dev/null; unset SSLPASS; }
sslTextDec () { sslTextPwd ; read -p "Texto a des-cryptografar: " TEXT; echo "${@}" | openssl aes-256-cbc -d -a -iter 2 -pass env:SSLPASS 2>/dev/null; unset SSLPASS; }
sslTextPwd () { [[ -z $SSLPASS ]] && read -s -p "Password: " SSLPASS && export SSLPASS; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment