Cryptographic algorithms often use padding schemes to make the plaintext less predictable. The OAEP (Optimal Asymmetric Encryption Padding) scheme should be used with RSA encryption. Using an outdated padding scheme such as PKCS1, or no padding at all, can weaken the encryption by making it vulnerable to a padding oracle attack.

Use the OAEP scheme when using RSA encryption.

In the following example, the BAD case shows no padding being used, whereas the GOOD case shows an OAEP scheme being used.

  • Mobile Security Testing Guide.
  • The Padding Oracle Attack.