Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

Recent developments have cast some doubt on the elliptic curves specified by NIST and used in many standards like TLS (for signatures with ECDSA and key agreement with ECDHE).

It seems like the standard allows for custom, server-generated ECDH-curves that are transmitted during the handshake (just like with non-elliptic DH).

  • Do common implementations actually support that, or are they restricted to the NIST-specified curves? I've traced TLS handshakes with Google Chrome and iOS; it seems like the elliptic_curves extension only specifies the curves secp{256,384,521}r1, and not arbitrary_explicit_{prime,char2}_curves.

  • What is the situation for elliptic curve certificates? TLS seems to require X.509 certificates complying to RFC3279 or any RFC that replaces it (which would be RFC5480). According to RFC3279, it's possible; in RFC5480, explicit or implicit curves are specifically excluded.

In general, to what extent are custom elliptic curves permitted by today's standards (TLS, S/MIME etc.) and supported by the various implementations (OpenSSL, NSS, proprietary ones)?

If they are not supported: Why? Is it more difficult to find "good" curves than to find suitable DH parameters? Are common curves easier to verify and/or implement? Are they faster?

share|improve this question
    
Finding curves is easy. Implementing curves is a bit annoying, especially if you can't take advantage of the particular properties of that curve. –  CodesInChaos Sep 9 '13 at 17:14
add comment

1 Answer

up vote 4 down vote accepted

The NIST has "defined" 15 "standard curves", specified in FIPS 186-4. Actually, they did not define them themselves; they inherited them from SEC. These 15 curves aggregate into 3 groups:

  • The P-* curves work in a "prime field" (point coordinates are integers modulo a prime p).
  • The B-* curves work in a "binary field" (point coordinates are values in GF(2m)).
  • The K-* curves work in the same fields as the B-* curves, but have a special structure which allows for faster computations.

NIST found out that there was a huge reluctance to implement support for these 15 curves, let alone for "general" curves, for a variety of reasons:

  • The involved mathematics are felt to be "hard" (that's harder to grasp than RSA or plain Diffie-Hellman).
  • ... even more so for curves in binary fields.
  • While it is possible to write "generic" curve-handling code, code which targets a specific curve is often simpler to implement and faster. In particular, the P-* curves work modulo prime values whose format makes implementation more efficient (fast modular reduction).
  • There have been recurrent and long-standing claims of patents, making the use of elliptic curve "risky".
  • ... especially for curves in binary fields;
  • ... and more generally for generic curves chosen to have some characteristic which is beneficial to implementation. It is not known whether a curve can be patented (as opposed to an implementation technique supported by a special curve structure), but uncertainty already does powerful dissuasion.

Thus, people were wary of implementing generic support for elliptic curves, because it seemed to be hard, detrimental to performance, and a legal minefield. Sticking to a few of the simpler curves seemed easier, faster and safer; and that's what happened. NIST (well, NSA) formalized this trend as their "suite B" cryptography suite, which mandates implementation of exactly two curves: P-256 and P-384.

In SSL/TLS and in X.509, arbitrary curves may be used. However, most implementations won't support arbitrary curves. OpenSSL supports all 15 NIST curves, but not arbitrary curves. Firefox supports only P-256 and P-384; I am not sure Microsoft's code (Windows, hence Internet Explorer) will accept more than that either (maybe P-521 as well). If you try to use any other curve than P-256 or P-384, then you will encounter interoperability issues (more issues than what you already get by trying to use elliptic curves at all). Some standard writers, feeling that they must "be practical", have fully admitted this fact, and just banned the use of other curves, as you see in RFC 5480.


Generating your own curve is not hard, but substantially harder than generating your own DH parameters. It involves point counting with Schoof's algorithm or a variant thereof. You won't be able to slap together a curve generator in one hour and a hundred lines of Java code, whereas producing DH parameters can be done under these constraints. The computational cost is also higher (you will still get a nice curve in a minute, but not in 100ms). To be brief, people don't do that often, or at all.

share|improve this answer
    
Thanks, that was very detailed and helpful! One more question: What about djb's Curve25519 and Ed25519? Could they be implemented by specifying a custom curve, or do the limitations you mentioned in your answer to a similar question still apply? (stackoverflow.com/a/2517052/1016939) –  lxgr Sep 12 '13 at 18:26
1  
Curve25519 has a special format which does not fit in the way a TLS server can specify a "generic curve". This does not preclude the existence of a future TLS extension which specifies Curve25519, but this has not happened yet; and even if that standard was written tomorrow, it would still take some substantial time (years, maybe decades) before non-negligible adoption occurs. –  Thomas Pornin Sep 12 '13 at 18:33
    
Hm, maybe we're better off that way - having to explicitly specify/announce it will probably avoid many compatibility issues (for example, libs that only support 25519 as a custom curve). Somebody apparently submitted a draft for Curve25519's use in TLS three days ago; maybe somebody will do the same for X.509 and Ed25519. Let's hope we'll see an implementation this decade :) ietfreport.isoc.org/idref/draft-josefsson-tls-curve25519 –  lxgr Sep 12 '13 at 19:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.