Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save omerfsen/5d0d9afedd150d29adacf777468a21e2 to your computer and use it in GitHub Desktop.
Save omerfsen/5d0d9afedd150d29adacf777468a21e2 to your computer and use it in GitHub Desktop.
Bash $STDIN Encryption with openssl and aes256
# Encrypt STDIN with Salt "045667221ABCDFFF", Password from STDIN
$ echo "message" | openssl enc -aes-256-cbc -a -S "045667221ABCDFFF" -pass pass:TEST
U2FsdGVkX18EVmciGrzf/1pWNVmPZ5FLXa+v68TZGGg=
# Decrypt STDIN with Salt "045667221ABCDFFF", Password from STDIN
$ echo "U2FsdGVkX18EVmciGrzf/1pWNVmPZ5FLXa+v68TZGGg=" | openssl enc -aes-256-cbc -a -d -S "045667221ABCDFFF" -pass pass:TEST
message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment