Skip to content

Instantly share code, notes, and snippets.

@pcuci
Created September 1, 2024 19:40
Show Gist options
  • Save pcuci/d4b57a2254edb375224cebaf3e58cca1 to your computer and use it in GitHub Desktop.
Save pcuci/d4b57a2254edb375224cebaf3e58cca1 to your computer and use it in GitHub Desktop.
Encrypt/Decrypt with a password one-liners
read -s -p "Password: " PASS && echo -e "\nEncrypted data: $(echo -n ${DATA} | openssl enc -aes-256-cbc -pbkdf2 -iter 10000 -a -salt -k "$PASS")"
read -s -p "Password: " PASS && read -p "Enter encrypted data: " ENCRYPTED_DATA && echo $ENCRYPTED_DATA | openssl enc -aes-256-cbc -d -pbkdf2 -iter 10000 -a -salt -k "$PASS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment