RSA-OAEP-2048
RSA encryption with Optimal Asymmetric Encryption Padding (PKCS #1 v2)
Old but not broken. Kept for interoperability; root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.
About RSA-OAEP-2048
RSA-OAEP-2048 is one of 3 RSA-OAEP variants in the NextSSL registry, a public-key encryption scheme. It uses a 0–190-byte output, a 264–288-byte public key, a 768–1,344-byte secret key, a 256-byte ciphertext and a 0–64-byte context string. Its registry entry cites RFC 8017. NextSSL lists it in the legacy tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).
Overview
RSA-OAEP is the padding scheme that makes RSA encryption secure against chosen-ciphertext attacks, specified in PKCS #1 version 2 (RFC 8017). It remains acceptable for interoperability but is classical and much larger and slower than modern alternatives.
Raw RSA encryption is deterministic and malleable. OAEP fixes this by encoding the message with a random seed through a two-round Feistel network built from a hash function and a mask generation function (MGF1), producing a padded block that is then raised to the public exponent modulo n. The construction is IND-CCA2 secure in the random oracle model, assuming the RSA problem is hard.
The main practical risk is implementation leakage. Manger's attack showed that if a decryptor reveals whether the first byte of the decoded block was zero, through error messages or timing, an attacker can decrypt ciphertexts. Decoding must therefore be constant time and must return a single uniform error. Three key sizes are present: 2048, 3072 and 4096-bit moduli. A 2048-bit key offers roughly 112-bit classical security and 3072-bit roughly 128-bit.
History
1977–2016RSA published by Rivest, Shamir and Adleman
PKCS #1 v1.5 published
RSA-OAEP published
Bleichenbacher's padding-oracle attack on PKCS #1 v1.5
PKCS #1 v2.2 published as RFC 8017
How it works
- KeyGen picks two large primes p and q, sets n = pq, and chooses e and d with ed = 1 mod lcm(p-1, q-1).
- Encrypt pads the message with a hashed label and random seed via MGF1 masking, then computes c = m^e mod n.
- Decrypt computes m = c^d mod n and reverses the OAEP encoding.
- Any decoding failure is reported identically, in constant time.
Security notes
Broken by a large quantum computer, and keys and ciphertexts are large compared with elliptic-curve or lattice schemes. Implementations that leak decoding errors or timing are vulnerable to Manger-style attacks. Prefer HPKE or a KEM for new designs.
Typical uses
Sizes
| Field | Bytes | Meaning |
|---|---|---|
| out | 0 – 190 | Output |
| pk | 264 – 288 | Public key |
| sk | 768 – 1,344 | Secret key |
| ct | 256 | Ciphertext |
| ctx | 0 – 64 | Context string |
Use it
from nextssl_demo import NextSSL
root = NextSSL(root=True) # tier 'legacy' is reachable from the root API only
pk, sk = root.call("pke_keygen", "rsa-oaep-2048", None, outs=2)
ct = root.call("pke_encrypt", "rsa-oaep-2048", None, pk, b"secret", b"")[0]
nextssl_root_pke_encrypt("rsa-oaep-2048", 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-OAEP variants
2Similar names
Looking for something else?More public-key encryption
All 32Frequently asked questions
What is RSA-OAEP-2048?
RSA-OAEP-2048 is a PKE in the RSA-OAEP family. RSA-OAEP is the padding scheme that makes RSA encryption secure against chosen-ciphertext attacks, specified in PKCS #1 version 2 (RFC 8017).
What are the RSA-OAEP-2048 sizes?
In NextSSL, RSA-OAEP-2048 uses: public key 264 to 288 bytes, ciphertext 256 bytes, output 0 to 190 bytes.
Who designed RSA-OAEP-2048 and when?
RSA-OAEP-2048 belongs to the RSA-OAEP family, first published in 1994 by Mihir Bellare, Phillip Rogaway (OAEP); Ron Rivest, Adi Shamir, Leonard Adleman (RSA). Its origin: PKCS #1 v2.2 (RFC 8017).
Which standards define RSA-OAEP-2048?
RSA-OAEP-2048 is referenced by RFC 8017.
Is RSA-OAEP-2048 safe to use?
RSA-OAEP-2048 is in the legacy tier. Old but not broken. Kept for interoperability; root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).
What other RSA-OAEP variants are there?
NextSSL also registers rsa-oaep-3072, rsa-oaep-4096 in the RSA-OAEP family.
Related families
The NIST Merkle–Damgård hash family behind most of today's TLS, signatures and software
ML-KEMNIST's primary post-quantum key encapsulation mechanism, standardised in FIPS 203
HPKEHybrid Public Key Encryption: a KEM, a KDF and an AEAD combined per RFC 9180
RSA PKCS #1 v1.5 encryptionLegacy RSA encryption padding, exposed to Bleichenbacher padding-oracle attacks