Skip to content

Instantly share code, notes, and snippets.

View omerfsen's full-sized avatar

Omer Sen omerfsen

View GitHub Profile
@omerfsen
omerfsen / bash-cli-openssl-stdin-encryption
Last active May 23, 2019 11:27 — forked from robert2d/bash-cli-openssl-stdin-encryption
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