RSA PKCS #1 v1.5 encryption
Legacy RSA encryption padding, exposed to Bleichenbacher padding-oracle attacks
Overview
PKCS #1 v1.5 encryption is the original padding format for RSA encryption, still found in older TLS, CMS and smart-card systems. Its structure enables padding-oracle attacks that have repeatedly broken real implementations, so it is classed as broken.
The format pads a message as 00 02, followed by at least eight nonzero random bytes, a zero byte and the message, then applies RSA. In 1998 Daniel Bleichenbacher showed that if a server reveals whether a decrypted ciphertext has this valid structure, an attacker can decrypt arbitrary ciphertexts or forge signatures through adaptive queries. Even the error messages or timing of a single server can be enough.
Mitigations require the decryptor to behave identically in every observable way for valid and invalid padding, which has proven extremely difficult. Variants of the attack, such as ROBOT in 2017 and the Marvin timing attack in 2023, found exploitable oracles in many major libraries and products years after the original paper. TLS 1.3 removed RSA key transport entirely. Three key sizes are present: 2048, 3072 and 4096-bit moduli, retained only for interoperability and testing.
History
1977–2016RSA published by Rivest, Shamir and Adleman
PKCS #1 v1.5 published
Bleichenbacher's padding-oracle attack on PKCS #1 v1.5
PKCS #1 v2.2 published as RFC 8017
How it works
- The message is padded as 0x00 0x02 || nonzero random bytes || 0x00 || M.
- The padded block is encrypted as c = m^e mod n.
- Decryption computes c^d mod n and checks the padding structure.
- Any observable difference in handling invalid padding creates a decryption oracle.
Security notes
Practically broken in deployed settings due to Bleichenbacher-style padding oracles (including ROBOT and Marvin). Do not use for new designs; use RSA-OAEP only for legacy interoperability, or preferably HPKE or ML-KEM.
Typical uses
Variants in NextSSL
3| Algorithm | Tier | Sizes (bytes) | Standards | API |
|---|---|---|---|---|
| RSA-PKCS#1 v1.5-ENC-2048 rsa-pkcs1v15-enc-2048 |
broken | out 0–245 · pk 264–288 · sk 768–1344 · ct 256 · ctx 0 | RFC 8017 | root |
| RSA-PKCS#1 v1.5-ENC-3072 rsa-pkcs1v15-enc-3072 |
broken | out 0–373 · pk 392–416 · sk 1152–1984 · ct 384 · ctx 0 | RFC 8017 | root |
| RSA-PKCS#1 v1.5-ENC-4096 rsa-pkcs1v15-enc-4096 |
broken | out 0–501 · pk 520–544 · sk 1536–2624 · ct 512 · ctx 0 | RFC 8017 | root |
Frequently asked questions
Which RSA PKCS #1 v1.5 encryption variants does NextSSL include?
NextSSL registers 3 RSA PKCS #1 v1.5 encryption variants: rsa-pkcs1v15-enc-2048, rsa-pkcs1v15-enc-3072, rsa-pkcs1v15-enc-4096.