A block type BT, a padding string PS, and the data D shall be formatted into an octet string EB, the encryption block. EB = 00 || BT || PS || 00 || D . (1) The block type BT shall be a single octet indicating the structure of the encryption block. For this version of the document it shall have value 00, 01, or 02. For a private- key operation, the block type shall be 00 or 01. For a public-key operation, it shall be 02.
During the decryption phase, the RSA encryption algorithm first converts things back to a block of data (ultimately each block is converted from an integer) and then does one additional verification process against this block type. If the block type doesn't match 01 or 02, it's likely the wrong key was used to decrypt. You have the wrong decryption key, may be not using the private key if the public key was used to encrypt, or the public key if the private key was used. (In the latter two cases, just the other pair has to be used to reverse the original operation.)
No comments:
Post a Comment