On this page
Overview
CryptoSwift is a pure-Swift collection of cryptographic primitives and utilities. It provides AES, ChaCha20/XChaCha20, SHA-2/SHA-3, HMAC, PBKDF2, HKDF, Scrypt, RSA, and related APIs across Apple platforms, Linux, and Android.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Use hashes, MACs, ciphers, and KDFs from Swift APIs
SHA-256/SHA-512/SHA-3, HMAC, AES, ChaCha20, PBKDF2, HKDF, Scrypt, and other algorithms are available with helpers for String, Data, and [UInt8], including incremental APIs.
Sources: [2]
Follow recommended defaults that favor modern hashes and AEAD
The README recommends AEAD constructions such as AES-GCM, AES-CCM, and ChaCha20-Poly1305 for new protocols, while treating MD5/SHA-1, ECB, and similar options as legacy interoperability features.
Sources: [2]
Best fit
Fits Swift code that needs cross-platform crypto or algorithms beyond Apple-only APIs
It is useful for protocol compatibility, cross-platform libraries, and cipher or KDF requirements that are not conveniently covered by CryptoKit or CommonCrypto alone.
Sources: [2]
Before adoption
Version 1.10.0 supports Swift 5.6+ and iOS 11+, and crypto-heavy workloads should be profiled in Release builds
Package.swift uses Swift tools 5.6 and declares iOS 11, macOS 10.13, tvOS 11, and watchOS 4 minimums. The README notes that Debug builds can be dramatically slower for crypto-heavy workloads. Version 1.10.0 also fixes XChaCha20-Poly1305 nonce metadata and Scrypt/SecureBytes memory handling.
Official sources
- [1]krzyzanowskim/CryptoSwift — GitHub repository(2026-10-06)
- [2]CryptoSwift 1.10.0 — README(2026-10-06)
- [3]CryptoSwift 1.10.0 — Package.swift(2026-10-06)
- [4]CryptoSwift 1.10.0 release(2026-10-06)
- [5]CryptoSwift license(2026-10-06)
Supplemental curator note
CryptoSwift fits cross-platform Swift and protocol-compatibility needs. For new designs, follow the project's modern AEAD and hash recommendations and benchmark crypto-heavy workloads in Release builds.
Try it in 3 steps
- 1
Add CryptoSwift 1.10.0 with SwiftPM
Pin the reviewed release. The current line supports Swift 5.6+ and iOS 11+.
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", exact: "1.10.0") - 2
Add the CryptoSwift product to the target
Link CryptoSwift from the target that performs cryptographic operations.
.product(name: "CryptoSwift", package: "CryptoSwift") - 3
Calculate a SHA-256 digest
Use the Data helper to calculate SHA-256 and render the digest as hexadecimal.
import CryptoSwift let digest = Data("hello".utf8).sha256() print(digest.toHexString())
Growth
Growth trends · Last 30 days
10,580 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 0
- Open PRs
- 4
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- swift
- aes
- cryptography
- commoncrypto
- cryptoswift
- md5
- sha1
- hmac-authentication
- sha3
- cipher
- digest
- aes-gcm
- Stars
- 10,580
- Forks
- 1,808
- Watchers
- 184
- Open issues
- 0
- Contributors
- 117
- Owner type
- User
- Primary language
- Swift
- License
- Not determined
- Repository last updated
- Aug 19, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- SDWebImage25,612 Stars
3 shared tag(s) · 1 shared category(s)
manage UIKit network images with asynchronous downloads and memory/disk caching
Objective-C - CocoaLumberjack13,321 Stars
3 shared tag(s) · 1 shared category(s)
route one DDLog API to console, os_log, rolling files, and custom loggers on Apple platforms
Objective-C - Aegis Authenticator13,213 Stars
3 shared tag(s) · 1 shared category(s)
keep two-factor secrets in an encrypted local vault with user-controlled backups
Java - Swift Async Algorithms3,713 Stars
2 shared tag(s) · 1 shared category(s) · Same language
add merge, combineLatest, debounce, throttle, and other time/order algorithms to AsyncSequence
Swift - KeychainAccess8,253 Stars
4 shared tag(s) · 2 shared category(s) · Same language
use Swift APIs for Apple Keychain storage, accessibility, and Face ID protection
Swift - Firebase Apple SDK6,926 Stars
4 shared tag(s)
integrate Firebase authentication, databases, messaging, Crashlytics, and other services into Apple apps
C++
Report incorrect information
Tell us if any listing information is incorrect or outdated.