Skip to content

post quantum via kyber #1141

Closed
Closed

Description

@xyhhx

rustls offers experimental post quantum crypto via kyber:
https://docs.rs/rustls-post-quantum/latest/rustls_post_quantum/

is this an option to enable for sozu? should it be considered if not?

Activity

  1. FlorentinDUBOIS commented on Oct 14, 2024

    @FlorentinDUBOIS
    Collaborator

    Hello 👋,
    Nice to meet you, I am glad that you are interested on Sōzu using Rustls. We do not have plan to change of crypto provider yet, maybe we should plan it. However, I am not a huge fan on introducing experimental features on Sōzu as we used for production and we want it to be as stable as possible. If we do implement another crypto provider today, it will be aws-lc in addition to ring, it will make more sense to me.

  2. xyhhx commented on Oct 25, 2024

    @xyhhx
    Author

    thanks for the reply! i was under the impression that sozu was already using rustls for crypto, which is why i was asking about it 😅

    in any case, would you consider it as an optional feature that users could enable at their whim (i agree that enabling experimental features by default isn't a great idea)?

    harvest now decrypt later1 is a real threat today. for those looking for a secure proxy for their servers who have this attack in their threat model, this would be a good feature for sozu to offer, even if opt-in. it's already an optional feature of other proxies2 like nginx3 and caddy4 (albeit if the user decides to compile them themselves, though in caddy's case this is trivial using xcaddy)

    regarding aws-lc, it too offers post-quantum cryptography5, whereas ring is planning to add it but hasn't as of yet6


    edit: sorry, re-reading my original comment i realize i misunderstood your reply. while ring doesn't offer ml-kem, and aws-lc-rs does, perhaps offering it as an opt-in feature is worth considering? i haven't really taken a deep look at the code to see how much work that'd entail

    Footnotes

    1. https://en.wikipedia.org/wiki/Harvest_now,_decrypt_later ↩

    2. https://pq.cloudflareresearch.com/ ↩

    3. https://mailman.nginx.org/pipermail/nginx/2023-August/NOISOYU3QTB2DGIYUBGF7CAMQHDI2QLT.html ↩

    4. https://gist.github.com/bwesterb/2f7bfa7ae689de0d242b56ea3ecac424 ↩

    5. https://github.com/aws/aws-lc/blob/main/crypto/fipsmodule/PQREADME.md ↩

    6. https://github.com/briansmith/ring/issues/1685 ↩

  3. FlorentinDUBOIS commented on Feb 11, 2025

    @FlorentinDUBOIS
    Collaborator

    Hi @xyhhx, I agree with you that we should be able to provide aws-lc crypto provider at least with a compiler feature flag that change it during the compilation phase.

  4. FlorentinDUBOIS commented on Apr 30, 2026

    @FlorentinDUBOIS
    Collaborator

    PR #1191 surfaces post-quantum support through the upstream rustls 0.23 providers rather than the dedicated rustls-post-quantum crate you linked. Specifically:

    • When built with --features crypto-aws-lc-rs or --features crypto-openssl, X25519MLKEM768 is the first-preference KX group on the HTTPS listener. ML-KEM is the NIST FIPS 203 standardised successor to Kyber, so this covers the use case.
    • Configurable per-listener via the new groups_list field on ListenerBuilder, with cipher_suite_by_name filtering through default_provider().cipher_suites so a FIPS build cannot silently advertise a non-FIPS group.
    • The pure-Rust crypto-ring provider does not yet support ML-KEM (ring upstream has no implementation). Operators who need post-quantum on ring would need to wait for ring + ML-KEM, or pick crypto-aws-lc-rs / crypto-openssl instead.

    So PR #1191 does not pull in rustls-post-quantum directly, but it does ship a working post-quantum hybrid for the providers that have native support today. If X25519MLKEM768 is what you were looking for, this issue can be closed when PR #1191 merges. If you specifically want rustls-post-quantum with the crypto-ring provider, please file a follow-up.

  5. FlorentinDUBOIS commented on May 2, 2026

    @FlorentinDUBOIS
    Collaborator

    Quick follow-up now that #1191 is merged on main:

    Post-quantum key exchange ships out of the box on builds that select a PQ-capable provider:

    # aws-lc-rs (recommended)
    cargo build -p sozu --release --no-default-features --features crypto-aws-lc-rs,jemallocator
    
    # OpenSSL 3.5+ (system OpenSSL)
    cargo build -p sozu --release --no-default-features --features crypto-openssl,jemallocator
    
    # FIPS 140-3 build (implies aws-lc-rs in FIPS mode; X25519MLKEM768 not FIPS-approved yet, NIST curves only)
    cargo build -p sozu --release --no-default-features --features fips,jemallocator

    The default groups_list already prioritises the hybrid:

    groups_list = ["X25519MLKEM768", "x25519", "P-256", "P-384"]

    PQ-capable clients (Chrome ≥ 124, Firefox ≥ 132, Go ≥ 1.23, BoringSSL, etc.) negotiate X25519MLKEM768; everyone else falls back to classical X25519/P-256/P-384 transparently. Unknown groups are silently skipped, so the same TOML works across all four provider builds.

    Notes:

    • Stayed on aws-lc-rs / OpenSSL providers rather than the rustls-post-quantum shim because that crate exposes the obsolete X25519Kyber768Draft00 codepoint over ring; X25519MLKEM768 (NIST FIPS 203 / draft-kwiatkowski-tls-ecdhe-mlkem) is what current PQ-capable clients negotiate.
    • The default crypto-ring build still has no ML-KEM (ring upstream: Add Kyber briansmith/ring#1685). Anyone wanting PQ on ring will need to wait for ring or switch provider — there is no need for a rustls-post-quantum opt-in any more since the modern equivalent is exposed natively by the other two providers.
    • Docs: doc/configure.md (TLS section / "Key exchange groups") and doc/getting_started.md (build matrix).

    Closing as fixed. Reopen if you hit anything that doesn't match this — happy to dig further.

  6. xyhhx commented on May 28, 2026

    @xyhhx
    Author

    wonderful! i'm very excited to try sozu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions