apple/swift-crypto
FreeOpen-source implementation of a substantial portion of the API of Apple CryptoKit suitable for use on Linux platforms.
About apple/swift-crypto
Swift Crypto is an open-source implementation of a substantial portion of Apple CryptoKit's API, designed for use on Linux and Windows platforms. It provides safe, high-level Swift interfaces for cryptographic operations including key exchange, key derivation, encryption, decryption, hashing, and message authentication. On Apple platforms, it transparently delegates to the native CryptoKit. The library uses vendored copies of BoringSSL and XKCP on non-Apple platforms and also offers a CryptoExtras product with additional functionality. It is distributed via Swift Package Manager and follows cryptographic best practices to encourage safe usage.
Key Features
Pros & Cons
- Open-source and free to use
- Cross-platform compatibility (Linux, Windows, Apple)
- Provides safe, high-level Swift API that encourages best practices
- Leverages well-vetted cryptographic libraries (BoringSSL, XKCP)
- Mirrors Apple CryptoKit API, easing development and porting
- Available via Swift Package Manager for easy integration
- Not a full replacement for Apple CryptoKit on Apple platforms (only a subset of APIs)
- May have performance differences compared to hardware-backed CryptoKit on Apple hardware
- Limited to software-based cryptography; no hardware security module support
- Requires Swift Package Manager and Swift toolchain for integration