Web application stacks

Post-quantum cryptography for Python, Node.js, PHP and Ruby web applications

Most web applications get quantum-safe key exchange from the TLS terminator in front of them, not from application code. We find out which of your services already negotiate ML-KEM, which do not, and where your own code signs or encrypts data that must stay protected for years.

3.5OpenSSL release that offers hybrid X25519MLKEM768 in TLS by default
24.7.0Node.js release that added ML-KEM and ML-DSA to crypto and WebCrypto
48.0.0pyca/cryptography release that enabled ML-KEM and ML-DSA on OpenSSL 3.5+
2035NCSC target for completing migration to PQC
Watch and download

Post-quantum migration in a few minutes

AI warning on cryptography: post-quantum migration explained (1:48) The 2 December joint statement, the deadlines, where RSA and ECC hide, and the five steps. Watch on YouTube
AI advances and cryptography: plan your post-quantum migration now (1:30) Why the 2 December warning matters for every stack, and what a migration involves. Watch on YouTube

The video loads from YouTube (youtube-nocookie.com) only when you press play.

Two layers: the TLS terminator and your own code

A Django, Flask, FastAPI, Express or Laravel application normally sits behind nginx, a cloud load balancer or a CDN. That component performs the TLS handshake, so it decides whether a browser's connection uses a hybrid post-quantum key exchange. Upgrading the terminator protects traffic in transit against harvest-now-decrypt-later without a line of application code changing.

The second layer is cryptography your application performs itself: signing tokens or documents, encrypting fields before they reach the database, wrapping keys, calling other services over TLS from a worker process. Here the language runtime and its libraries matter, and support differs sharply between Python, Node.js, PHP and Ruby.

The NCSC asks organisations to finish discovery and an initial plan by 2028, complete the highest-priority migrations by 2031 and finish by 2035. For a web estate, discovery means knowing both layers for every service. See our cryptographic inventory and NCSC timeline pages.

Quantum-safe TLS for web applications: where it comes from

OpenSSL 3.5 (April 2025) added ML-KEM, ML-DSA and SLH-DSA, and changed its TLS defaults to offer X25519MLKEM768 and X25519 key shares, preferring hybrid groups. It is supported until April 2030. Anything linked to OpenSSL 3.5 or later that keeps the default group list negotiates the hybrid group with a client that offers it.

nginx uses ssl_ecdh_curve auto by default, which takes the list built into OpenSSL. Built against OpenSSL 3.5+, a default configuration therefore prefers the hybrid group. A configuration that names explicit curves, such as prime256v1:secp384r1, silently excludes it; we check for exactly that.

Cloud load balancers differ. AWS Application and Network Load Balancers support hybrid key exchange as an opt-in through post-quantum security policies such as ELBSecurityPolicy-TLS13-1-2-Res-PQ-2025-09; existing listeners must be switched. Google Cloud's Application and Network Proxy Load Balancers announced an opt-in phase in June 2026, default-on from October 2026. Cloudflare offers X25519MLKEM768 to visitors and to origins, and suggests Cloudflare Tunnel for origins that cannot yet do it themselves.

Browsers already ask for it: Cloudflare's support matrix lists hybrid key agreement as default in Chrome 131+, Firefox 132+ on desktop and Safari 26+. Protection only applies when both ends support the same algorithm, and the hop from the terminator to your application servers is a separate connection that needs its own answer. More detail on our hybrid TLS with ML-KEM page.

Hybrid TLS at the edge does not change your certificates, signatures or stored data. It is the fastest first step, not the whole migration.

Support matrix: ML-KEM and ML-DSA by language

What each runtime offers to application code as of the date at the foot of this page. Versions are the first release with the feature; your build may link a different OpenSSL, so we always confirm on the deployed artefact.

Post-quantum primitives in web runtimes (facts checked 2 December 2026)
RuntimeML-KEM / ML-DSA in codeHybrid TLS as a clientNotes
Python (pyca/cryptography)ML-KEM-768/1024 and ML-DSA-44/65/87 from 47.0.0 with AWS-LC or BoringSSL; on OpenSSL 3.5+ from 48.0.0Follows the OpenSSL that Python's ssl module is linked toML-DSA X.509 signing from 49.0.0; ML-DSA X.509 verification on by default from 50.0.0
Node.jsML-DSA key pairs from 24.6.0; ML-KEM, crypto.encapsulate/decapsulate and WebCrypto ML-KEM/ML-DSA from 24.7.0; SLH-DSA from 24.8.0Default in 24.5.0+ and 22.20.0+ (bundled OpenSSL 3.5)WebCrypto PQC marked as active development; hybrid WebCrypto KEMs from 26.10.0
PHP (ext/openssl)No ML-KEM or ML-DSA key types or KEM functionsFollows the OpenSSL on the hostA proposal to add generic KEM and provider-based keys is under discussion (September 2026)
Ruby (openssl)ML-KEM and ML-DSA work merged upstream (ruby/openssl#894), per the Ruby core feature ticketFollows the linked OpenSSL; groups set via SSLContext#groups= from openssl 4.0.0Wider stdlib support (net-http, RubyGems, Bundler) tracked in Ruby Feature #22068

Post-quantum cryptography in Python

The cryptography package added MLKEM768PrivateKey, MLKEM1024PrivateKey and MLDSA44/65/87PrivateKey in 47.0.0, at first only for AWS-LC or BoringSSL builds. Release 48.0.0 extended them to OpenSSL 3.5.0 or later. Its wheels have been compiled with OpenSSL 4.0.0 since 47.0.0, so a current pip install should expose them, but if the backend lacks an algorithm the call raises UnsupportedAlgorithm: test on your build, not on a laptop. Later releases added ML-DSA certificates (49.0.0), default ML-DSA X.509 verification (50.0.0) and OpenSSH ssh-mldsa44-ed25519 keys (51.0.0).

For TLS, Python's ssl module uses whichever OpenSSL it was built against. Python 3.15 added SSLContext.set_groups(), SSLContext.get_groups() and SSLSocket.group(), so you can now pin and log the negotiated group from Python itself. The Open Quantum Safe liboqs-python bindings exist, but the project describes liboqs as designed for prototyping and evaluation.

ML-KEM-768 and ML-DSA-65 with cryptography 48.0.0+ (from the project's documentation)
from cryptography.hazmat.primitives.asymmetric.mlkem import MLKEM768PrivateKey
from cryptography.hazmat.primitives.asymmetric.mldsa import MLDSA65PrivateKey

private_key = MLKEM768PrivateKey.generate()
shared_secret, ciphertext = private_key.public_key().encapsulate()
assert private_key.decapsulate(ciphertext) == shared_secret

signing_key = MLDSA65PrivateKey.generate()
signature = signing_key.sign(b"my authenticated message")
signing_key.public_key().verify(signature, b"my authenticated message")

Node.js: ML-KEM in crypto and WebCrypto

Node.js 24.5.0 moved to OpenSSL 3.5, and 22.20.0 did the same for the 22 LTS line. That is enough for outbound TLS from a Node service to offer the hybrid group. Third-party builds that link an external OpenSSL are not affected by the bundled upgrade, so container images built on a distribution's Node package need checking separately.

For application code, generateKeyPair gained ML-DSA in 24.6.0, ML-KEM in 24.7.0 and SLH-DSA in 24.8.0; crypto.encapsulate() and crypto.decapsulate() arrived in 24.7.0. WebCrypto exposes ML-KEM-512/768/1024 and ML-DSA-44/65/87 from 24.7.0 through subtle.encapsulateKey(), subtle.decapsulateKey() and the *Bits variants, marked as active development. Node 25.9.0 stopped importing ML-KEM and ML-DSA PKCS#8 keys that lack a seed, a detail that matters if you store keys.

ML-KEM-768 with node:crypto, Node.js 24.7.0+ (adapted from the Node.js documentation)
import { promisify } from 'node:util';
import { generateKeyPair, encapsulate, decapsulate } from 'node:crypto';

const { publicKey, privateKey } = await promisify(generateKeyPair)('ml-kem-768');
const { ciphertext } = encapsulate(publicKey);
decapsulate(privateKey, ciphertext);

PHP post-quantum and Ruby: rely on the platform for now

PHP's ext/openssl offers RSA, DSA, DH, EC, X25519, Ed25519, X448 and Ed448 key types, and no KEM operations. A September 2026 php-internals thread proposes generic provider-based keys and KEM encapsulation; a reply notes the extension also lacks other OpenSSL 3.5 and 4 features. There is no RFC or implementation yet, and third-party extensions exist. For a Laravel or Symfony estate the practical route today is to get hybrid TLS from the terminator, keep the host's OpenSSL current for outbound calls, and move long-lived signing to a service or KMS that supports ML-DSA (see cloud KMS, HSM and PKI).

Ruby is further ahead: the Ruby core feature ticket on PQC states that ruby/openssl already gained ML-KEM and ML-DSA capabilities, with SLH-DSA in review and work continuing on net-http, RubyGems and Bundler. Since openssl gem 4.0.0, SSLContext#groups= replaces ecdh_curves=. Rails applications usually terminate TLS at a proxy, so the same edge-first plan applies.

How BEK helps web teams migrate

  1. Assessment

    We list every public and internal endpoint, record the TLS terminator, its library version and the negotiated group, and search your Python, Node.js, PHP and Ruby code for RSA, ECDSA, ECDH and JWT signing that protects long-lived data.

  2. Upgrade

    We plan runtime and terminator upgrades: OpenSSL 3.5+ under nginx, the PQ security policy on AWS load balancers, Node 22.20+/24.5+, cryptography 48+, and the hop from proxy to application.

  3. Implement

    Where your own code needs post-quantum primitives, we add hybrid constructions behind one interface so algorithms can change later, using the verified library APIs above.

  4. Test and evidence

    We capture handshakes showing the negotiated group, run regression and interoperability tests with older clients, and hand over a written record for your auditors. We provide evidence of what changed; we do not certify compliance.

Engagements

Start with a free call, then a fixed-price assessment

Every migration starts by finding where your cryptography actually is. We work on any stack: .NET, Java, Go, Python, Node.js, PHP, Rust, C and C++, iOS and Android, cloud KMS, HSMs and PKI. Prices are fixed before work starts. BEK Service Ltd is not VAT registered, so no VAT is added.

Free readiness call

Free 30 minutes

A video call with an engineer. Tell us what you run; we tell you where your quantum-vulnerable cryptography most likely is, what the deadlines mean for you, and whether an assessment is worth it.

  • Your stacks, vendors and data lifetimes
  • Which deadlines apply to you
  • A straight answer on next steps
Book the free call

Migration and implementation

Quoted after the assessment

We do the work: runtime upgrades, crypto-agility layers, hybrid TLS, PQC signatures and key exchange, testing and the evidence your customers or auditors ask for.

  • Runtime and library upgrades on any stack
  • Hybrid ML-KEM key exchange, ML-DSA signatures
  • PKI, KMS and HSM changes
  • Regression and interop testing
  • Evidence pack for customers and auditors
Ask for a quote
  1. Discover

    Inventory every algorithm, key, certificate, library and protocol in scope.

  2. Prioritise

    Rank by how long the data must stay secret and how hard each change is.

  3. Upgrade

    Move runtimes and libraries to versions that support NIST's PQC standards.

  4. Implement

    Hybrid key exchange first, then PQC signatures, behind a crypto-agile layer.

  5. Evidence

    Test, document and hand over what your customers and auditors ask for.

FAQ

Questions we are asked

Does my Django or Laravel app need code changes to be quantum-safe in transit?

Usually not for browser traffic. Hybrid key exchange is negotiated by whatever terminates TLS, such as nginx on OpenSSL 3.5+, a cloud load balancer with a post-quantum policy or Cloudflare. Code changes are needed only where your application signs or encrypts data itself.

Which Python cryptography version supports ML-KEM?

ML-KEM and ML-DSA appeared in 47.0.0 for AWS-LC or BoringSSL builds, and 48.0.0 added support when cryptography uses OpenSSL 3.5.0 or later. If your build's backend lacks the algorithm, the API raises UnsupportedAlgorithm.

Which Node.js version added ML-KEM?

Node.js 24.7.0 added ML-KEM key pairs, crypto.encapsulate and crypto.decapsulate, and ML-KEM and ML-DSA in WebCrypto. ML-DSA key pairs arrived in 24.6.0. The WebCrypto support is marked as active development.

Can PHP do post-quantum cryptography?

Not through ext/openssl today: it has no ML-KEM or ML-DSA key types or KEM functions, and a proposal to add them is still under discussion. PHP sites can still get hybrid TLS from the web server or load balancer in front of them.

Is the connection from my load balancer to my app servers covered?

Not automatically. It is a separate TLS connection with its own settings. AWS, for example, publishes separate post-quantum policies for backend connections. We check every hop.

Will enabling hybrid TLS break older clients?

Clients that do not offer the hybrid group fall back to classical key exchange. The known risk is legacy middleboxes that mishandle the larger ClientHello, which is why we test before and after.

Can you guarantee our web estate is compliant?

No. We provide an assessment, an implementation and evidence of what was changed and tested. Compliance decisions remain with you and your assessors.

Sources

Facts checked against the sources below on 2026-12-02. Standards and product support change; tell us if something here is out of date. This page is general information, not legal or compliance advice.

  1. OpenSSL 3.5 release notes (OpenSSL Library, 2025-04-08)
  2. cryptography changelog (Python Cryptographic Authority, 2026-12-01)
  3. ML-KEM key encapsulation (Python Cryptographic Authority, 2026-12-02)
  4. ML-DSA signing (Python Cryptographic Authority, 2026-12-02)
  5. ssl — TLS/SSL wrapper for socket objects (Python Software Foundation, 2026-12-02)
  6. Crypto module documentation (Node.js, 2026-12-02)
  7. Web Crypto API documentation (Node.js, 2026-12-02)
  8. Node.js 24.5.0 release notes (Node.js, 2025-07-31)
  9. Node.js 22.20.0 release notes (Node.js, 2025-09-24)
  10. OpenSSL key types (PHP Documentation Group, 2026-12-02)
  11. ext/openssl provider-based keys and KEM discussion (PHP internals (externals.io), 2026-09-05)
  12. Feature #22068: PQC support in standard libraries (Ruby issue tracker, 2026-05-13)
  13. ruby/openssl History (Ruby, 2026-12-02)
  14. Module ngx_http_ssl_module (nginx, 2026-12-02)
  15. Post-quantum support matrix (Cloudflare, 2026-12-02)
  16. PQC in Cloudflare products (Cloudflare, 2026-12-02)
  17. Application and Network Load Balancers support post-quantum key exchange for TLS (Amazon Web Services, 2025-11-21)
  18. Quantum-safe key exchange for Application and Network Proxy Load Balancers (Google Cloud, 2026-06-02)
  19. liboqs-python (Open Quantum Safe, 2026-10-28)
  20. Timelines for migration to post-quantum cryptography (NCSC, 2025-03-20)
Talk to an engineer

Book your free 30-minute readiness call

Tell us what you run and what is driving the question: a customer questionnaire, a government contract, a regulator or your own roadmap. We reply within one working day with times for a call.

Prefer e-mail? Write to sales@bekservice.uk.

BEK Service Ltd, a software company registered in England and Wales (company no. 12590587). We use what you send only to answer you; see our privacy policy.