Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides Swift CryptoKit use for hashing, HMAC, AES-GCM and ChaChaPoly encryption, signing, key agreement, HPKE, and Secure Enclave keys.
73% 95%+23 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 16 of 22 without it.
3 of 3 safety checks passed
Not used yet
Apple CryptoKit provides a Swift-native API for cryptographic operations: hashing, message authentication, symmetric encryption, public-key signing, key agreement, HPKE, quantum-secure key encapsulation/signing, and Secure Enclave-backed keys. Most core primitives are available on iOS 13+; check availability for HPKE (iOS 17+) and SHA-3 / post-quantum APIs (iOS 26+). Prefer CryptoKit over CommonCrypto or raw Security framework APIs for new cryptographic primitive code targeting Swift 6.3+.
Use SHA256/SHA384/SHA512 on iOS 13+; SHA3_256/SHA3_384/SHA3_512 require iOS 26+. All conform to HashFunction.
import CryptoKit
let data = Data("Hello, world!".utf8)
let digest = SHA256.hash(data: data)
let hex = digest.compactMap { String(format: "%02x", $0) }.joined()
Next to this one in the catalogue, plus more from the same author.