Answer the question
In order to leave comments, you need to log in
Why does openssl and base64 produce different results?
I want to encode to base64 in the console. Found 2 ways, using openssl and using base64. But they give different results!
echo -n 'hello' | openssl base64 // aGVsbG8=
base64 <<< 'hello' // aGVsbG8K
Answer the question
In order to leave comments, you need to log in
Because you are passing them different strings.
Remove -n and the result will be the same.
$ echo 'hello' | openssl base64
aGVsbG8K
$ base64 <<< 'hello'
aGVsbG8K
$ echo 'hello' | base64
aGVsbG8K
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question