Why RSA encryption can return different results with C# and Java?

后端 未结 4 840
梦毁少年i
梦毁少年i 2021-01-14 03:39

I using:

  • c#: RSACryptoServiceProvider
  • JAVA: KeyFactory.getInstance(\"RSA\")+Cipher

I sending public key (exponent + mo

4条回答
  •  暖寄归人
    2021-01-14 04:04

    RSA Parameters contains more parameters than modulus and exponent if i remember correctly. You need fully initialized rsa parameters to get the encryption correct (in .net).

    Moreover, your private and private key is not even set in .net

提交回复
热议问题