Answer the question
In order to leave comments, you need to log in
Openssl and Base64 what's wrong?
Hello. Help with a question.
You need to hash and sign the string.
Here is an example that works fine:
echo "TesTIK" | openssl dgst -sha256 -sign openssl/private.key > sign.sig
openssl dgst -verify openssl/public.key -sha256 -signature sign.sig -binary <<< "TesTIK"
echo "TesTIK" | openssl dgst -sha256 -sign openssl/private.key > sign.sig
base64 sign.sig > base64.txt
base64 -d base64.txt > decoded.sig
openssl dgst -verify openssl/public.key -sha256 -signature sign.sig -binary decoded.sig
Answer the question
In order to leave comments, you need to log in
Maybe it's too late (I'm looking for answers on this topic myself now), but the thing is that in the first case you correctly check the signature through the source with the public key ("Testik" string), and in the second you try to check the signature through the signature, but you need to the same check through the source (the same string "Testik").
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question