OpenSSL and MS CryptoAPI: different digital signatures

前端 未结 1 436
Happy的楠姐
Happy的楠姐 2021-01-13 08:31

I generated X509 certificate with private key using makecert utility

makecert -n \"CN=RootCATest\" -r -sv RootCATest.pvk RootCATest.cer 
makecert -sk MyKeyNa         


        
1条回答
  •  走了就别回头了
    2021-01-13 09:09

    How can I obtain the same signature?

    Most digital signature algorithms - including RSA, which I suppose you have used here, are non-deterministic. Try signing the same file twice with the same program, and you will get different outputs.

    This means, running the same algorithm twice with the same input will give you different signatures. This is not a problem, as long as the verification algorithm still manages to accept all signatures generated by the signing algorithm (with the fitting key).

    This non-determinism is often actually necessary for the security of the signature scheme.

    To see if your two signature algorithms are actually compatible, try to verify the OpenSSL signature with the MS Crypto API, and to verify the MS Crypto signature with OpenSSL. (Then modify the file by one byte and check that they don't verify anymore.)

    0 讨论(0)
提交回复
热议问题