$ echo -n "juntao/pas$$w0rd" | openssl enc -e -aes-256-cbc -a -salt
type your password twice:
enter aes-256-cbc encryption password:xxxxx
Verifying - enter aes-256-cbc encryption password:xxxxx
and you will get a string like this:
U2FsdGVkX18isExx5kk885ZxJc54+gu7fwlVKGU3zrM=
and if you want it be decrypted, simplye do this:
$ echo "U2FsdGVkX18isExx5kk885ZxJc54+gu7fwlVKGU3zrM=" | openssl enc -d -aes-256-cbc -a -salt
Note the -d
option in command openssl, that indicate decrypt
, after you type the correct password, you will see the decrypted string:
juntao/pas$$w0rd