Sanniv Khare 6 min read

Post-quantum TLS on iOS 26: what URLSession and CryptoKit do now

Post-quantum TLS on iOS 26: what URLSession and CryptoKit do now

The short answer: an iOS app that uses URLSession already gets post-quantum key exchange on iOS 26, with no code change, as long as the server supports it and nothing in the app caps TLS at 1.2. We built one small test package with Xcode 26.2 and ran it unchanged on the iOS 18.5 and iOS 26.3 Simulators against Cloudflare: iOS 26.3 negotiated X25519MLKEM768, iOS 18.5 negotiated plain X25519, and a session capped at TLS 1.2 fell back to X25519 on both. CryptoKit’s ML-KEM-768 and ML-DSA-65 types worked as documented, with the sizes below.

Why we did this: the NSA advisory of 1 December 2026 asks operators to move key exchange off 256-bit elliptic curves now, and the first question from banking-app teams we work with was “do we have to ship anything?”. For the TLS part of a Beacon-type banking app, mostly no. Here is what we checked and what is left to do.

What the advisory asks, in one paragraph

Filippo Valsorda’s reading of the NSA advisory (2 Dec 2026) sums it up: inventory the algorithms you use for key establishment, signatures and certificates, move TLS key exchange to the hybrid X25519MLKEM768 as soon as possible, and prepare signatures for ML-DSA (with RSA 3072 or P-384 as stopgaps). For a mobile app, key exchange is the part the client controls, so that is where we started.

What Apple says iOS 26 does

Apple’s support note Prepare your network for quantum-secure encryption in TLS (25 June 2026) says that on iOS 26, iPadOS 26, macOS Tahoe 26 and visionOS 26, “TLS-protected connections will automatically advertise support for hybrid, quantum-secure key exchange in TLS 1.3”. The ClientHello carries X25519MLKEM768 in supported_groups with a matching key share, and the server picks it or falls back to another advertised group. There is no opt-in for apps. The one warning: some old servers fail on the larger ClientHello and the connection breaks, a server bug Apple links to tldr.fail.

The test: same app, same server, two iOS versions

We wrote a Swift package with one function that fetches Cloudflare’s trace endpoint, which echoes the negotiated TLS version and key exchange group (kex=). Two XCTest cases call it: one with a default ephemeral session, one with tlsMaximumSupportedProtocolVersion = .TLSv12.

public static func handshake(maxTLS: tls_protocol_version_t? = nil) async throws -> [String: String] {
    let config = URLSessionConfiguration.ephemeral
    if let maxTLS { config.tlsMaximumSupportedProtocolVersion = maxTLS }
    let session = URLSession(configuration: config)
    let (data, _) = try await session.data(from: traceURL)
    var out: [String: String] = [:]
    for line in String(decoding: data, as: UTF8.self).split(separator: "\n") {
        let parts = line.split(separator: "=", maxSplits: 1).map(String.init)
        if parts.count == 2, ["tls", "kex", "http", "sni"].contains(parts[0]) { out[parts[0]] = parts[1] }
    }
    return out
}

We built it with Xcode 26.2 (17C52, Swift 6.2.3, iOS 26.2 SDK, deployment target iOS 18) on our M1 lab Mac and ran the tests on an iOS 26.3.1 Simulator and an iOS 18.5 Simulator on 4 December 2026. Both runs passed.

Comparison: iOS 18.5 negotiates X25519, iOS 26.3 negotiates X25519MLKEM768, and both fall back to X25519 when TLS is capped at 1.2

Real output from our test runs: one binary, two Simulator runtimes, one server.

What the results say:

  • The OS decides, not the SDK. The same build got X25519 on iOS 18.5 and X25519MLKEM768 on iOS 26.3. Users on older iOS versions stay on classical key exchange whatever you ship.
  • A TLS 1.2 cap silently removes it. Post-quantum groups exist only in TLS 1.3. Any tlsMaximumSupportedProtocolVersion = .TLSv12, or a server or proxy that stops at 1.2, gives you X25519 with no error.
  • Nothing else changed. Same HTTP version (HTTP/2 on both iOS runs), same response, both tests green.

For comparison, the same package run natively on the lab Mac’s macOS 15.7.3 also negotiated plain X25519, which matches Apple’s note that the feature starts with the 26 releases.

This is a Simulator test. The Simulator runs the iOS runtime’s own networking stack, so the negotiated group is a fair signal, but a run on a physical iPhone and through your own network path is still the check that counts before you tell a security reviewer it is done.

CryptoKit: ML-KEM and ML-DSA for your own protocols

TLS covers transport. If your app encrypts or signs data itself (a key exchange with your backend for end-to-end payloads, signed device attestations, sealed local backups), CryptoKit has post-quantum types from iOS 26 and macOS 26: MLKEM768, MLKEM1024, MLDSA65, MLDSA87, Secure Enclave variants, and the X-Wing HPKE ciphersuite. Apple’s sample Enhancing your app’s privacy and security with quantum-secure workflows walks through each.

CryptoKit ML-KEM-768 encapsulate and decapsulate, and ML-DSA-65 sign and verify

The core of our test package, condensed.

We ran three tests on the iOS 26.3 Simulator: an ML-KEM-768 round trip, an ML-DSA-65 sign and verify (plus a tampered message that must fail), and 200 ML-KEM round trips in a loop.

CryptoKit post-quantum tests passing on the iOS 26.3 Simulator with key and signature sizes

Real output, with the sizes in bytes.

The sizes are the ones to plan for, and they match the FIPS 203 and FIPS 204 parameter sets:

Object Bytes Compare
ML-KEM-768 public key 1,184 X25519 public key: 32
ML-KEM-768 ciphertext 1,088
Shared secret 32 same as X25519
ML-DSA-65 public key 1,952 P-256 public key: 65 (uncompressed)
ML-DSA-65 signature 3,309 P-256 ECDSA: 64 (raw)

If your backend stores public keys in a fixed-width column, or sends signatures in a header, those numbers are what break first. The 200 ML-KEM round trips averaged 0.216 ms each in that one Simulator run on an M1; treat that as “fast enough not to matter for a login flow”, not as a benchmark. The CryptoKit MLKEM768 reference lists the full API, including OneTimePrivateKey for ephemeral use.

What a banking app should check

For a Beacon-type banking app (React Native or UIKit, URLSession underneath), our list after this test:

  1. Search for TLS caps. Grep the app and its networking SDKs for tlsMaximumSupportedProtocolVersion and TLSv12. A cap left over from a past server incident now also turns off post-quantum key exchange.
  2. Check your API servers, not the app. The handshake only goes hybrid if the server offers X25519MLKEM768. On macOS Tahoe 26, Apple’s note gives nscurl --tls-diagnostics https://your-api.example; a supporting server reports group X25519MLKEM768. A server that does not support it still connects, on a classical group.
  3. Certificate pinning is unaffected. Pinning checks the server’s certificate or public key; post-quantum key exchange changes how the session key is agreed, not the certificate. Your pins keep working. The certificates themselves stay RSA or ECDSA for now.
  4. Watch for the large-ClientHello bug. If a load balancer or WAF in front of your API is old, iOS 26 users may fail to connect while iOS 18 users are fine. That pattern in crash or error logs after a rollout points here.
  5. Leave CryptoKit for your own protocols. Only reach for MLKEM768 or X-Wing where you encrypt application data yourself, and size your storage and headers for the numbers above.

Sources

Planning your build Macs for the next Xcode as well? See Xcode 27.3 needs macOS Tahoe 26.6.

Made by the team behind this post

Apps from our studio

  • Goes with this post

    Nix

    The Mac uninstaller that finds what the Trash leaves behind: caches, logs, derived data and saved states.

    macOS

    Get
  • Goes with this post

    Cardigami

    Pop-up greeting cards that rise out of the fold on iPhone Duo.

    iPhone · App Store

    Get
  • Goes with this post

    OneClick QuitAll

    Quit every running app in one click. See memory and CPU first.

    macOS · Mac App Store

    Get
  • BMDB.fun

    Your Bollywood world at a glance, with links straight to the OTT app that streams each film.

    Android TV · Web · Mobile

    Get

Need this built? Let’s talk.

We build and run apps for Mac, TV, mobile and the web, and write about what we learn.