0

in terminal: command is:

 openssl dgst -sha224 -sign privateKey.pem -out signature1 someInputFile

In my c code, first generate digest of Inputfile the same as command line inputfile, the digest is the same. but when call RSA_sign generate signature, the signature is different? why this situation happens?

enter image description here

Déjà vu
  • 28,223
  • 6
  • 72
  • 100
  • both the method use same private RSA key. – jude.zhang Nov 26 '17 at 13:59
  • Please show the code relevant to the question. – Déjà vu Nov 26 '17 at 14:09
  • hello, ring, thanks. – jude.zhang Nov 27 '17 at 02:25
  • you can see the answer i post, i copy the code snapshot. – jude.zhang Nov 27 '17 at 02:26
  • The signatures are randomized. Also see [Are RSA signatures deterministic?](https://crypto.stackexchange.com/q/6515/10496), [RSA signing, same private key but different signature?](https://stackoverflow.com/q/41382110/608639), [Why are the RSA signatures I generate with openssl and golang different?](https://stackoverflow.com/q/37202268/608639), [Why are the RSA-SHA256 signatures I generate with OpenSSL and Java different?](https://stackoverflow.com/q/13419201/608639), [Multiple OpenSSL RSA signing methods produce different results](https://stackoverflow.com/q/38767660/608639), etc... – jww Nov 28 '17 at 03:17

0 Answers0