---
title: Apple CryptoKit
framework: cryptokit
role: collection
role_heading: Framework
platforms: [iOS 13.0+, iPadOS 13.0+, Mac Catalyst 15.0+, macOS 10.15+, tvOS 15.0+, visionOS 1.0+, watchOS 8.0+]
path: cryptokit
---

# Apple CryptoKit

Perform cryptographic operations securely and efficiently.

## Overview

Overview Use Apple CryptoKit to perform common cryptographic operations: Compute and compare cryptographically secure digests. Use public-key cryptography to create and evaluate digital signatures, and to perform key exchange. In addition to working with keys stored in memory, you can also use private keys stored in and managed by the Secure Enclave. Generate symmetric keys, and use them in operations like message authentication and encryption. Prefer CryptoKit over lower-level interfaces. CryptoKit frees your app from managing raw pointers, and automatically handles tasks that make your app more secure, like overwriting sensitive data during memory deallocation.

## Topics

### Essentials

- [Complying with Encryption Export Regulations](security/complying-with-encryption-export-regulations.md)
- [Performing Common Cryptographic Operations](cryptokit/performing-common-cryptographic-operations.md)
- [Storing CryptoKit Keys in the Keychain](cryptokit/storing-cryptokit-keys-in-the-keychain.md)
- [Enhancing your app’s privacy and security with quantum-secure workflows](cryptokit/enhancing-your-app-s-privacy-and-security-with-quantum-secure-workflows.md)

### Cryptographically secure hashes

- [HashFunction](cryptokit/hashfunction.md)
- [SHA512](cryptokit/sha512.md)
- [SHA384](cryptokit/sha384.md)
- [SHA256](cryptokit/sha256.md)

### Message authentication codes

- [HMAC](cryptokit/hmac.md)
- [SymmetricKey](cryptokit/symmetrickey.md)
- [SymmetricKeySize](cryptokit/symmetrickeysize.md)

### Ciphers

- [AES](cryptokit/aes.md)
- [ChaChaPoly](cryptokit/chachapoly.md)

### Public key cryptography

- [Curve25519](cryptokit/curve25519.md)
- [P521](cryptokit/p521.md)
- [P384](cryptokit/p384.md)
- [P256](cryptokit/p256.md)
- [SharedSecret](cryptokit/sharedsecret.md)
- [SecureEnclave](cryptokit/secureenclave.md)
- [HPKE](cryptokit/hpke.md)

### Key derivation functions

- [HKDF](cryptokit/hkdf.md)

### Key encapsulation mechanisms (KEM)

- [KEM](cryptokit/kem.md)
- [MLKEM768](cryptokit/mlkem768.md)
- [MLKEM1024](cryptokit/mlkem1024.md)
- [XWingMLKEM768X25519](cryptokit/xwingmlkem768x25519.md)

### KEM keys

- [KEMPrivateKey](cryptokit/kemprivatekey.md)
- [KEMPublicKey](cryptokit/kempublickey.md)

### Errors

- [CryptoKitError](cryptokit/cryptokiterror.md)
- [CryptoKitASN1Error](cryptokit/cryptokitasn1error.md)

### Legacy algorithms

- [Insecure](cryptokit/insecure.md)

### Protocols

- [DiffieHellmanKeyAgreement](cryptokit/diffiehellmankeyagreement.md)
- [HPKEDiffieHellmanPrivateKey](cryptokit/hpkediffiehellmanprivatekey.md)
- [HPKEDiffieHellmanPrivateKeyGeneration](cryptokit/hpkediffiehellmanprivatekeygeneration.md)
- [HPKEDiffieHellmanPublicKey](cryptokit/hpkediffiehellmanpublickey.md)
- [HPKEKEMPrivateKey](cryptokit/hpkekemprivatekey.md)
- [HPKEKEMPrivateKeyGeneration](cryptokit/hpkekemprivatekeygeneration.md)
- [HPKEKEMPublicKey](cryptokit/hpkekempublickey.md)
- [HPKEPublicKeySerialization](cryptokit/hpkepublickeyserialization.md)
- [KEMOneTimePrivateKey](cryptokit/kemonetimeprivatekey.md)

### Structures

- [CorecryptoCurveType](cryptokit/corecryptocurvetype.md)
- [SHA3_256](cryptokit/sha3_256.md)
- [SHA3_256Digest](cryptokit/sha3_256digest.md)
- [SHA3_384](cryptokit/sha3_384.md)
- [SHA3_384Digest](cryptokit/sha3_384digest.md)
- [SHA3_512](cryptokit/sha3_512.md)
- [SHA3_512Digest](cryptokit/sha3_512digest.md)

### Type Aliases

- [CryptoKitMetaError](cryptokit/cryptokitmetaerror.md)
- [SHA2_256](cryptokit/sha2_256.md)
- [SHA2_384](cryptokit/sha2_384.md)
- [SHA2_512](cryptokit/sha2_512.md)

### Enumerations

- [MLDSA65](cryptokit/mldsa65.md)
- [MLDSA87](cryptokit/mldsa87.md)
