RSA-PKCS#1 v1.5-ENC-4096
Legacy RSA encryption padding, exposed to Bleichenbacher padding-oracle attacks
Practical attacks exist. Present for compatibility and research only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About RSA-PKCS#1 v1.5-ENC-4096
RSA-PKCS#1 v1.5-ENC-4096 is one of 3 RSA PKCS #1 v1.5 encryption variants in the NextSSL registry, a public-key encryption scheme. It uses a 0–501-byte output, a 520–544-byte public key, a 1,536–2,624-byte secret key and a 512-byte ciphertext. Its registry entry cites RFC 8017. NextSSL lists it in the broken tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
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
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| out | 0 – 501 | Output |
| pk | 520 – 544 | Public key |
| sk | 1,536 – 2,624 | Secret key |
| ct | 512 | Ciphertext |
| ctx | 0 | Context string |
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'broken' is reachable from the root API only
pk, sk = root.call("pke_keygen", "rsa-pkcs1v15-enc-4096", None, outs=2)
ct = root.call("pke_encrypt", "rsa-pkcs1v15-enc-4096", None, pk, b"secret", b"")[0]
nextssl_root_pke_encrypt("rsa-pkcs1v15-enc-4096", NULL, pk, pt, label, out);
// pke is a root-only kind: use the C ABI (nextssl_root_*)
// or the Pke trait in nextssl-core/src/traits.rs
Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.
Other RSA PKCS #1 v1.5 encryption variants
2More public-key encryption
All 32Frequently asked questions
What is RSA-PKCS#1 v1.5-ENC-4096?
RSA-PKCS#1 v1.5-ENC-4096 is a PKE in the RSA PKCS #1 v1.5 encryption family. PKCS #1 v1.5 encryption is the original padding format for RSA encryption, still found in older TLS, CMS and smart-card systems.
What are the RSA-PKCS#1 v1.5-ENC-4096 sizes?
In NextSSL, RSA-PKCS#1 v1.5-ENC-4096 uses: public key 520 to 544 bytes, ciphertext 512 bytes, output 0 to 501 bytes.
Who designed RSA-PKCS#1 v1.5-ENC-4096 and when?
RSA-PKCS#1 v1.5-ENC-4096 belongs to the RSA PKCS #1 v1.5 encryption family, first published in 1993 by RSA Laboratories (PKCS #1). Its origin: PKCS #1 (RFC 8017, retained for compatibility).
Which standards define RSA-PKCS#1 v1.5-ENC-4096?
RSA-PKCS#1 v1.5-ENC-4096 is referenced by RFC 8017.
Is RSA-PKCS#1 v1.5-ENC-4096 safe to use?
RSA-PKCS#1 v1.5-ENC-4096 is in the broken tier. Practical attacks exist. Present for compatibility and research only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).
What other RSA PKCS #1 v1.5 encryption variants are there?
NextSSL also registers rsa-pkcs1v15-enc-2048, rsa-pkcs1v15-enc-3072 in the RSA PKCS #1 v1.5 encryption family.