While decrypting text using RSACryptoServiceProvider.Decrypt
, I am getting the error:
Error occurred while decoding OAEP padding.
In my case the error has been caused by wrong padding settings.
Error: RSA decrypt: error:0407A079:rsa routines:RSA_padding_check_PKCS1_OAEP:oaep decoding error
I had openssl_public_encrypt()
with OPENSSL_PKCS1_PADDING
as a default value in PHP and keypair.decrypt()
with the default value RSA_PKCS1_OAEP_PADDING
in node-rsa.
So don't forget to check these options too.