cryptokit

Perform hashing, signing, encryption, and key agreement in Swift with CryptoKit.

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/harshav167/build-ios-apps --skill cryptokit-harshav167
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cryptokit
Source: https://github.com/harshav167/build-ios-apps/tree/main/skills/cryptokit
Command: npx skills add https://github.com/harshav167/build-ios-apps --skill cryptokit-harshav167

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Enable developers to perform cryptographic operations in Swift safely and efficiently using CryptoKit, covering hashing, signing, encryption, and key exchange with Secure Enclave support.

Core Features & Use Cases

  • Hashing with SHA-2/SHA-3 where available, HMAC, and secure digest comparisons.
  • Symmetric encryption with AES-GCM and ChaChaPoly, including AAD support.
  • Public-key signing with P256/P384/P521 and Curve25519.
  • Key agreement via ECDH (P256/Curve25519) and HPKE on supported iOS versions.
  • Post-quantum capabilities (ML-KEM, ML-DSA, X-Wing) guarded by iOS 26+ availability.

Quick Start

Try a simple sign-and-verify workflow using CryptoKit to sign data with Curve25519 or P256 and verify the signature.

Frequently Asked Questions about cryptokit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use CryptoKit for AES-GCM encryption and key agreement in Swift?

CryptoKit provides AES-GCM encryption and ECDH key agreement in Swift, supporting P256 and Curve25519. It handles symmetric encryption with AAD support and derives shared secrets safely across iOS 13+ apps.

Can I store cryptographic keys in the Secure Enclave using Swift CryptoKit?

Yes, CryptoKit enables Secure Enclave usage for cryptographic operations in Swift. You can safely handle keys, perform signing, and manage key agreements directly within the Secure Enclave on supported iOS hardware.

Does CryptoKit support post-quantum cryptography like ML-DSA and HPKE?

CryptoKit supports HPKE and post-quantum APIs including ML-KEM, ML-DSA, and X-Wing variants. These advanced cryptographic capabilities are guarded by iOS 26+ availability checks on supported hardware.

What is the best way to perform SHA-2 hashing and HMAC in Swift?

CryptoKit is the best way to perform SHA-2 and SHA-3 hashing in Swift. It provides secure digest computations, HMAC authentication, and constant-time digest comparisons to ensure data integrity.

How do I sign and verify data using Curve25519 or P256 keys in Swift?

CryptoKit enables public-key signing and verification in Swift using P256, P384, P521, and Curve25519. You can securely sign data payloads and validate signatures to ensure authenticity.

Are there limitations when using HKDF key derivation and ChaChaPoly on older iOS versions?

CryptoKit supports HKDF derivation and ChaChaPoly encryption on iOS 13+, but limitations apply to newer features. HPKE and post-quantum ML-DSA capabilities require iOS 26+ availability guards to function correctly.