hi can any tell me why this error occurs while decrypt the RSA Private key encrypted message.
i am Verifying the Signature of the message signed by the Java and verifying the Signature using openssl 0.9.8g
This usually means that the encrypting side and the decrypting side are using different padding scheme. They need to be the same on both sides.
If you use Bouncy Castle in Java, you can specify the padding scheme (in this case, PKCS #1 padding) in the cipher like this:
Cipher cipher = Cipher.getInstance("RSA/None/PKCS1Padding", "BC");
In openssl, you can specify the padding scheme in the encrypt/decrypt command:
openssl rsautl -pkcs -decrypt ...
Here, option "-pkcs" specifies the PKCS #1 padding scheme.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With