Public-key encryption

RSA-OAEP-3072

RSA encryption with Optimal Asymmetric Encryption Padding (PKCS #1 v2)

legacy Root API only
Legacy tier.

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-3072

RSA-OAEP-3072 is one of 3 RSA-OAEP variants in the NextSSL registry, a public-key encryption scheme. It uses a 0–318-byte output, a 392–416-byte public key, a 1,152–1,984-byte secret key, a 384-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–2016
  1. RSA published by Rivest, Shamir and Adleman

  2. PKCS #1 v1.5 published

  3. RSA-OAEP published

  4. Bleichenbacher's padding-oracle attack on PKCS #1 v1.5

  5. PKCS #1 v2.2 published as RFC 8017

How it works

  1. 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).
  2. Encrypt pads the message with a hashed label and random seed via MGF1 masking, then computes c = m^e mod n.
  3. Decrypt computes m = c^d mod n and reverses the OAEP encoding.
  4. 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

Interoperability with existing PKCS #11, JOSE and CMS systemsKey wrapping in legacy enterprise and HSM workflowsEncrypting small secrets to an RSA certificate

Sizes

FieldBytesMeaning
out0 – 318Output
pk392 – 416Public key
sk1,152 – 1,984Secret key
ct384Ciphertext
ctx0 – 64Context 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-3072", None, outs=2)
ct = root.call("pke_encrypt", "rsa-oaep-3072", None, pk, b"secret", b"")[0]

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Other RSA-OAEP variants

2

Frequently asked questions

What is RSA-OAEP-3072?

RSA-OAEP-3072 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-3072 sizes?

In NextSSL, RSA-OAEP-3072 uses: public key 392 to 416 bytes, ciphertext 384 bytes, output 0 to 318 bytes.

Who designed RSA-OAEP-3072 and when?

RSA-OAEP-3072 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-3072?

RSA-OAEP-3072 is referenced by RFC 8017.

Is RSA-OAEP-3072 safe to use?

RSA-OAEP-3072 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-2048, rsa-oaep-4096 in the RSA-OAEP family.