deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

The unexplained NIST curve seeds your TLS stack quietly trusts

A dev.to post revisits the NSA-generated seeds behind the NIST curves most TLS stacks rely on, arguing they are a trust decision rather than a flaw, and points to transparent alternatives like X25519.

The unexplained NIST curve seeds your TLS stack quietly trusts

A post on dev.to is drawing attention to a piece of cryptographic plumbing that almost nobody who depends on it ever inspects: the seeds from which the NIST elliptic curves were built. Written by a sysadmin going by Schiff Heimlich, and prompted by a deep dive from Filippo Valsorda on where the ECDSA curve seeds came from, the piece argues that operators running modern TLS stacks routinely trust constants whose origin they cannot verify.

Opaque constants from the 1990s

The NIST curves P-256, P-384 and P-521 — the workhorses behind most ECDSA certificates, favoured over RSA for their smaller keys and better performance — were each derived from a seed. Those seeds are public. The P-256 seed, for example, is c49d3608 86e70493 6a6678e1 139d26b7 819f7e90.

What is not public, according to the post, is what went into them. The seeds were produced by the NSA in the 1990s, ostensibly by hashing some input with SHA-1. The stated explanation was that a random value was hashed, but the value itself was never published. That leaves anyone using the curves unable to reproduce the derivation — which rather defeats the point of publishing a seed, namely letting outsiders confirm the parameters were not hand-picked to hide a weakness.

A trust question, not a known flaw

Heimlich is careful not to claim a backdoor. The cryptographic community has analyzed the NIST curves extensively and found no weakness, the post notes. The issue is provenance: when nginx is configured with ssl_ecdh_curve secp256r1, or Go's crypto/tls picks P-256 by default, the operator is trusting an unexplained constant generated decades ago.

For most deployments, the post concedes, that is fine — the math holds up. But in regulated environments, or wherever an auditor will not accept unverifiable claims of randomness, alternatives exist.

Transparent alternatives

The post highlights two families of curves whose constants anyone can check:

  • Curve25519 and Ed25519. Their equivalent starting values are fully explainable — the small integer 9 for Curve25519, and a hash of the string "Ed25519" for Ed25519. Both are widely supported in modern TLS libraries. The suggested configuration puts X25519 first while keeping P-256 for compatibility: ssl_ecdh_curve X25519:secp256r1; in nginx, or CurvePreferences: []tls.CurveID{tls.X25519, tls.P256} in Go's tls.Config.
  • Brainpool curves. Variants such as brainpoolP256r1 derive their seeds from the digits of pi and e, giving transparent parameters in a shape closer to the NIST curves. The trade-off is narrower support across implementations.

Auditing what you actually run

Before changing anything, the post suggests checking what your infrastructure negotiates in practice rather than relying on assumptions about defaults:

openssl s_client -connect yourhost:443 -curves P-256:X25519 </dev/null 2>/dev/null | grep "Curve is"

Why it matters

This is less a security emergency than a hygiene issue for anyone responsible for TLS. The curves themselves are not known to be broken, and the post explicitly does not call for ripping out P-256 tomorrow. But the seeds behind them represent a standing trust decision that most teams have never consciously made, and in environments with compliance requirements around cryptographic parameters, that decision is hard to defend without documentation.

The practical takeaway from the dev.to piece is modest and actionable: know which curves your services negotiate, understand why, and if verifiable provenance matters to you, prefer curves like X25519 whose constants can be checked by anyone. The seeds are not a vulnerability, the post concludes — they are a trust decision, and one worth making deliberately.

  • #tls
  • #cryptography
  • #ecdsa
  • #nist-curves
  • #curve25519