A device has an incident report to send. The reporting service publishes a public key. The message has to pass through a relay, but the relay has no business reading it. How can the device and the reporting service use the same encryption key if they have never shared one?
Hybrid Public Key Encryption (HPKE) solves that problem in two parts. Public-key cryptography gives the sender and recipient the means to derive the same secret. Symmetric authenticated encryption uses a key derived from that secret to protect the report itself. The device can send the protected message without waiting for the recipient to answer. [1]
HPKE Explained in Three Parts
The word hybrid is about the division of labor. Public-key cryptography solves the problem of establishing secret material for a particular recipient. Symmetric cryptography handles the actual data efficiently. Our history of modern encryption explains why these roles are distinct.
HPKE specifies how three ingredients work together. A cipher suite selects one algorithm for each role. [1]
| Ingredient | Job in HPKE | Example |
|---|---|---|
| Key encapsulation mechanism (KEM) | Uses the recipient’s public key to establish a shared secret. Produces an encapsulation the recipient can use with its private key to recover the same secret. | DHKEM based on X25519 and HKDF-SHA256 |
| Key derivation function (KDF) | Turns the shared secret and context into the key and base nonce needed by the encryption context, among other derived values. | HKDF-SHA256 |
| Authenticated encryption with associated data (AEAD) | Encrypts the payload and lets the recipient detect alterations to it or to selected associated data. | AES-128-GCM |
That combination appears in the test vectors of RFC 9180. The same hash-based KDF name appears twice because the example KEM has an internal derivation step, and the HPKE key schedule then performs its own derivation. [1]
Here, “hybrid” means combining public-key and symmetric cryptography. It does not mean the suite combines classical and post-quantum algorithms. The X25519 example is classical.
Follow One Report Through Base Mode
Consider a fictional reporting application. Its device has an authentic copy of the reporting service’s public key. The service keeps the corresponding private key. They have agreed on the HPKE suite and on how to encode the message and its headers.
- Encapsulate. Using the service’s public key, the device produces a shared secret and a public value called
enc. With the X25519-based KEM in this example,encis the encoded ephemeral public key. The matching ephemeral private key stays with the sender. - Derive. HPKE’s key schedule uses the shared secret and setup context, including application-supplied
info, to derive the encryption key and base nonce. An application might useinfoto distinguish version 1 of its reporting protocol from another use of the same system. - Seal and send. The device encrypts the report with the AEAD. It can include an unencrypted record identifier as associated data, or
aad. It sendsencand the ciphertext, which includes the authentication tag, plus whatever headers its protocol requires. - Open. The recipient uses its private key and
encto obtain the same shared secret. It reconstructs the context with the sameinfoand opens the ciphertext with the expectedaad. If the authentication check fails, the recipient does not accept the plaintext. [1, 2]
The relay can see enc. That’s by design. The encapsulation is data for establishing the secret, not the symmetric encryption key sent alongside the message. With this KEM, the sender and recipient compute matching Diffie–Hellman material using different private keys. An observer who sees both public keys cannot feasibly do the same under the scheme’s assumptions.
Here’s the difference between the two kinds of context. The setup input info binds the context to the key schedule. The aad binds bytes to a particular encrypted message. If the relay changes a record identifier that the device authenticated as aad, opening the ciphertext with the changed identifier fails. If that identifier must stay private, put it inside the encrypted payload instead. Neither input is automatically sent or kept secret by HPKE. [1, 2]
What Actually Travels With the Report?
Take a report of exactly 1,024 bytes, encrypted once using the X25519-based suite with AES-128-GCM from our example. The encapsulation is 32 bytes. The ciphertext is 1,040 bytes, including a 16-byte tag. Together, those two HPKE outputs take 1,072 bytes. [1, 2]
That is an accounting example. It excludes framing, key identifiers, routing headers, optional padding, and any associated data sent along with the ciphertext. HPKE specifies the cryptographic construction; the enclosing protocol specifies how to represent and deliver the pieces. The report’s size is not hidden merely because its contents are encrypted.
If a protocol sends multiple messages under one HPKE context, the context tracks a sequence number to derive the nonce for each message. That is part of why a protocol must respect context state and usage limits. Our cryptographic nonce guide explains what can go wrong when a key and nonce are reused. [1]
A Valid Ciphertext Doesn’t Tell You Who Sent It
Suppose the opened report says, “This was sent by device 42.” In Base mode, anyone with the service’s public key can make a new valid ciphertext. The AEAD can reject changes to an existing protected report. It does not establish that the original creator was device 42.
RFC 9180 defines four modes: Base, PSK, Auth, and AuthPSK. PSK mode adds possession of a pre-shared key. Auth mode uses a sender key pair with a KEM that supports authenticated encapsulation. AuthPSK combines both. The application still needs to decide which keys to trust and what identity or permission each key represents. [1]
That leaves three questions the reporting protocol must answer:
- Where did the recipient’s public key come from? If somebody substitutes their own key before the device encrypts, the device may protect the report for the wrong recipient.
- Is this report new? Replaying the same one-shot message can be different from forging a new one. The protocol must define its replay policy, for example rejecting previously processed identifiers within the relevant scope.
- What happens after key compromise? In the Base mode example, obtaining the recipient’s private key later can expose captured reports. An ephemeral sender key does not provide forward secrecy against compromise of that recipient key. [1]
Where HPKE Shows Up on the Network
TLS Encrypted Client Hello (ECH). Defined in RFC 9849, ECH uses HPKE to encrypt an inner ClientHello. Sensitive fields such as the intended server name can go in the inner message, while an outer ClientHello remains visible. This protects part of the handshake; it does not hide the destination IP address or replace the TLS connection that follows. [3]
Oblivious HTTP (OHTTP). Defined in RFC 9458, OHTTP uses HPKE to protect a request for a gateway while a relay forwards the encrypted message. The relay sees the client connection but cannot read the protected request. The gateway decrypts the request but does not receive the client’s transport connection. That separation depends on the design’s trust assumptions, including that the relay and gateway do not cooperate to link the two sides. It cannot hide identity information that the request itself reveals. Our MASQUE explainer examines a different HTTP proxy architecture and asks the same useful question: who can see what? [4]
RFC 9180 was published as an Informational RFC in 2022. At review on November 15, 2026, the IETF’s proposed Standards Track successor, draft-ietf-hpke-hpke-06, was still an Internet-Draft. For deployment, follow the version and suite required by the protocol you are implementing and use a maintained implementation of that profile. [1, 5]
The relay can carry the package without reading the report. The recipient can open it without having exchanged a session key with the device beforehand. HPKE makes those two things possible together. The surrounding protocol still decides what to trust about the message once it opens.
References and Further Reading
- RFC 9180: Hybrid Public Key Encryption — modes, context setup, single-shot operations, security limits, and test vectors.
- RFC 5116: An Interface and Algorithms for Authenticated Encryption — AEAD inputs, associated data, and the AES-GCM ciphertext expansion.
- RFC 9849: TLS Encrypted Client Hello — the ECH handshake and its privacy model.
- RFC 9458: Oblivious HTTP — the split between relay and gateway and its security assumptions.
- IETF: Hybrid Public Key Encryption, Internet-Draft 06 — proposed Standards Track successor; work in progress.
