# apple/swift-crypto

Open-source implementation of a substantial portion of the API of Apple CryptoKit suitable for use on all Swift supported platforms.

Repository: https://github.com/apple/swift-crypto
Canonical: https://ross.abutalabs.com/products/swift-crypto
Homepage: https://swiftpackageindex.com/apple/swift-crypto/documentation/crypto
Language: Assembly
License: Apache-2.0
License Family: permissive
Topics: cryptography, elliptic-curves, hash-functions, ciphers, ecdsa, ecdh, eddsa, boringssl, swift-crypto, swift
Last push: 2026-08-24T12:59:39+00:00

## Health v2 (maintenance only)
Score: 97/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 93, longevity 100
- inputs: {"age_days": 2598, "days_push": 9, "days_rel": 48, "gap_med": 13.5, "n_releases_24m": 33}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1718, forks 217 (observed 2026-08-28T04:05:26.520757+00:00)

## What it is
Swift Crypto is an open-source Swift library implementing a substantial portion of Apple CryptoKit's API for use on Linux, Windows, and other Swift-supported platforms. On Apple platforms it simply re-exports CryptoKit, while elsewhere it backs the same API with vendored BoringSSL and XKCP implementations.

## Use cases
- add hashing and message authentication to a server-side Swift app on Linux
- perform key exchange and key derivation in a cross-platform Swift package
- encrypt and decrypt data with a safe CryptoKit-style API on Windows
- sign and verify messages with ECDSA or EdDSA in Swift
- share one cryptography API across iOS and Linux codebases
- use server-focused crypto APIs via CryptoExtras

## When to choose
- you want CryptoKit's API on non-Apple platforms like Linux or Windows
- you need a safe, best-practice cryptography API in Swift
- you're building server-side Swift applications needing hashing, encryption, or key exchange
- you want portable crypto code shared between Apple and non-Apple targets

## When to avoid
- you only target Apple platforms and can use CryptoKit directly
- you need low-level control over cryptographic primitives
- you need algorithms outside CryptoKit's scope not offered by CryptoExtras
- you're not using Swift or the Swift Package Manager ecosystem

## Facets
- artifact type: library
- maturity: active
- function: cryptography, security
- domain: security, developer-tools, backend
- platform: windows
- tags: cryptokit, boringssl, swift-package-manager, hashing, key-exchange, elliptic-curves, server-side-swift, linux, macos, ios, swift

## Member repositories
- apple/swift-crypto (main) score 97

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:26.520757+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:34:09.854132+00:00, confidence not recorded.
  - readme: https://github.com/apple/swift-crypto (fetched 2026-08-28T04:05:26.520757+00:00, sha da031fb4af54)
- Data as of 2026-08-30T08:39:29.467469+00:00.
