Error: RSA_padding_check_PKCS1_type_1: block type is not 01 ..?

Hi, can someone tell me why this error occurs when decrypting an encrypted RSA Private Key message.

I am verifying the Signature of a Java signed message and verifying Signature using openssl 0.9.8g

+4
source share
1 answer

This usually means that the encryption side and the decryption side use a different padding scheme. They must be the same on both sides.

If you use Bouncy Castle in Java, you can specify the padding scheme (in this case, the PKCS # 1 add-on) in the cipher as follows:

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 ... 

The "-pkcs" parameter here indicates PKCS # 1 padding scheme.

Hope this helps.

+1
source

All Articles