<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/HPKE",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit4HPKEO"
  },
  "title" : "HPKE"
}
-->

# HPKE

A container for hybrid public key encryption (HPKE) operations.

```
enum HPKE
```

## Overview

Hybrid public key encryption (HPKE) uses a symmetric encryption algorithm to encrypt data, and encapsulates the symmetric
encryption material using a public key encryption algorithm.

HPKE ensures that the ciphertext wasn’t tampered with after its creation. It can also check the validity
of additional cleartext data in apps where you need to send headers or other metadata as cleartext.

HPKE optionally incorporates sender authentication, allowing the recipient to validate the authenticity of
messages using the sender’s public key.

HPKE is described in the Internet Research Task Force (IRTF) document
[RFC 9180](https://www.ietf.org/rfc/rfc9180.pdf).

## Topics

### Sending and receiving messages

[`Sender`](/documentation/CryptoKit/HPKE/Sender)

A type that represents the sending side of an HPKE message exchange.

[`Recipient`](/documentation/CryptoKit/HPKE/Recipient)

A type that represents the receiving side of an HPKE message exchange.

### Choosing cryptographic algorithms

[`Ciphersuite`](/documentation/CryptoKit/HPKE/Ciphersuite)

Cipher suites to use in hybrid public key encryption (HPKE).

[`AEAD`](/documentation/CryptoKit/HPKE/AEAD)

The authenticated encryption with associated data (AEAD) algorithms to use in HPKE.

[`KDF`](/documentation/CryptoKit/HPKE/KDF)

The key derivation functions to use in HPKE.

[`KEM`](/documentation/CryptoKit/HPKE/KEM)

The key encapsulation mechanisms to use in HPKE.

[`DHKEM`](/documentation/CryptoKit/HPKE/DHKEM)

A container for Diffie-Hellman key encapsulation mechanisms (KEMs).

### Handling errors

[`Errors`](/documentation/CryptoKit/HPKE/Errors)

Hybrid public key encryption (HPKE) errors that CryptoKit uses.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)