I try to get the same output from jwt.io and openssl
. As long as I do not mark "secret base64 encoded", I can take the part before the signature, run it through
echo -n "pasted data from jwt.io" | \
| openssl dgst -binary -sha512 -hmac abc \
| openssl enc -base64 -A;
and I get the same signature back from openssl as jwt.io is showing (using HS512!).
If I click the "secret base64 encoded", obviously the signature changes on jwt.io. Now I encode the secret "abc" with base64 to get "YWJj" and use this as the secret for openssl as in
echo -n "pasted data from jwt.io" | \
| openssl dgst -binary -sha512 -hmac YWJj \
| openssl enc -base64 -A;
This does not create the same signature, so I am likely misunderstanding this checkbox. What exactly does it and how would I need to call openssl
to simulate it?
(I know there is a difference between base64 and base64 urlencode, but this should not make a difference for the encoding of "abc".)