Public-key encryption: following a message through its digital envelope
Public-key encryption assigns different jobs to two related keys. The public part lets someone prepare protected material for a recipient; the corresponding private part lets that recipient recover it. In the RSA specification, RFC 8017, those jobs appear as separate operations with explicitly different inputs. Encryption takes a public key and a message representative, while decryption takes the matching private key and ciphertext. The distinction survives even when an application packages the message in several layers: possession of the openly distributed key does not supply the private operation needed to open it.
RSA makes that division concrete. Its public key contains a modulus and public exponent; one representation of its private key contains the modulus and a private exponent. Section 5.1 defines the mathematical operations, while section 7 adds complete encryption schemes around them. For public-key encryption using RSAES-OAEP, the sender encodes the message with a randomly generated seed before applying the RSA operation. The receiving operation recovers and checks that encoding. The specification treats encoding, length restrictions and failure handling as parts of an encryption scheme, rather than treating raw exponentiation as an entire messaging system.
The digital envelope in RFC 5652, Cryptographic Message Syntax, introduces another key with another job. A sender generates a random content-encryption key and uses it to encrypt the content. In the specification's key-transport method, public-key encryption protects that content key for each recipient. The resulting EnvelopedData structure contains the encrypted content together with recipient-specific information. There can be several recipients without several separately encrypted copies of the complete content. Each recipient opens an appropriate protected copy of the content key, then uses the recovered key to decrypt the content. CMS also defines key agreement, prearranged symmetric keys and password-based methods, so the envelope's key-management information matters. Its name alone does not identify which method was used. The key-transport case connects the public key to a small secret that unlocks the larger encrypted payload, with a separate RecipientInfo value recording the information needed for each intended recipient.
OpenPGP gives this arrangement a particularly visible packet structure. RFC 9580, published in 2024, specifies a fresh random session key for each object. The sender encrypts that session key using each recipient's public key, and these encrypted session keys precede the encrypted message. On receipt, the private key recovers the session key; a message key derived from it recovers the message. Compression, when used, is reversed afterward. Public-key encryption therefore need not mean that the public-key algorithm processes every word of a long document. Version 6 public-key encrypted session-key packets include an algorithm identifier and, except for anonymous recipients, a recipient-key fingerprint. These fields describe which protected key material accompanies the payload. They do not turn the recipient's published fingerprint into a decryption secret. Multiple protected session-key packets can accompany the same encrypted material because the intended recipients have different key pairs.
A different problem arises before any envelope is sealed: which public key belongs to the intended person or system? RFC 5280 describes certificates as structures binding public-key values to named subjects through a trusted certification authority's signature. A certificate can travel openly because its role is to establish that binding. Where the signer is not already trusted directly, a certification path can connect it to an authority whose public key is already held securely. The specification also describes revocation when circumstances change, including suspected compromise of the corresponding private key. A signed certificate and a private decryption key consequently perform different tasks. Certificate validation supplies grounds for accepting a public key's association with a subject; it does not hand over the associated private key. Public-key encryption depends both on choosing the intended recipient's key and on that recipient retaining control of the private material.
Digital signatures assign the public key a different job. RFC 8032 defines EdDSA signing with a private key and verification with a public key. Its verification procedure takes the message as an input, together with the signature and public key. It checks whether the signature satisfies the required mathematical relationship and rejects malformed or inconsistent inputs. It does not recover a concealed message from the signature. The document supplies separate signing and verification procedures, with defined key and signature encodings. This makes the distinction operational: a signature verifier already has the message whose integrity it is checking. Public-key encryption is concerned with recovering confidential content, while this signature operation checks an association between a message and signing key. OpenPGP can apply both services, attaching a signature before encrypting the combined material. A sender's signing private key and a recipient's decryption private key can therefore participate in one exchange while retaining their separate roles.
- IETF, RFC 8017: PKCS #1, RSA Cryptography Specifications Version 2.2, sections 3, 5 and 7 (2016) — www.rfc-editor.org
- Russ Housley, RFC 5652: Cryptographic Message Syntax, section 6 (2009) — www.rfc-editor.org
- IETF, RFC 9580: OpenPGP, sections 2.1 and 5.1 (2024) — www.rfc-editor.org
- IETF, RFC 5280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile, section 3 (2008) — www.rfc-editor.org
- Simon Josefsson and Ilari Liusvaara, RFC 8032: Edwards-Curve Digital Signature Algorithm, sections 3.2–3.4 (2017) — www.rfc-editor.org