I am currently renewing an SSL certificate, and I was considering switching to elliptic curves. Per Bernstein and Lange, I know that some curves should not be used but I’m having difficulties selecting the correct ones in OpenSSL:

Could a kind cryptographer point out to me which curves are still considered safe?

Answers

1.

You are misreading Bernstein and Lange’s advice (admittedly, their presentation is a bit misleading, with the scary red “False” tags). What they mean is not that some curves are inherently unsafe, but that safe implementation of some curves is easier than for others (e.g. with regards to library behaviour when it encounters something which purports to be the encoding of a valid curve point, but is not).

What you really want is a curve such that:

  • the software which you will entrust with your private key (your SSL server) is properly implemented and will not leak details about your private key;
  • interoperability will be achieved.

For a SSL server certificate, an “elliptic curve” certificate will be used only with digital signatures (ECDSA algorithm). The server will sign only messages that it generates itself; and, in any case, the only “private” operation involving a curve in ECDSA is multiplication of the conventional base point (hardcoded, since it is part of the curve definition, hence correct) by a random value that the server generates. Therefore, in your use case, there is no risk of private key leakage that would be specific to the used curve. If your SSL implementation is poor, it will be poor for all curves, not for just some of them.

“Interoperability” means that you would probably prefer it if SSL clients can actually connect to your server; otherwise, having a SSL server would be rather pointless. This simplifies the question a lot: in practice, average clients only support two curves, the ones which are designated in so-called NSA Suite B: these are NIST curves P-256 and P-384 (in OpenSSL, they are designated as, respectively, “prime256v1” and “secp384r1”). If you use any other curve, then some widespread Web browsers (e.g. Internet Explorer, Firefox…) will be unable to talk to your server.

Use P-256 to minimize trouble. If you feel that your manhood is threatened by using a 256-bit curve where a 384-bit curve is available, then use P-384: it will increases your computational and network costs (a factor of about 3 for CPU, a few extra dozen bytes on the network) but this is likely to be negligible in practice (in a SSL-powered Web server, the heavy cost is in “Web”, not “SSL”).

2.

I’d say stick to secp521r1 – even DJB says P-521 is pretty nice prime, and it’s also supported in every modern crypto library.

In the same time, we should push forward adoption of non-NIST curves like Curve25519, which will be fully rigid, less prone to implementation errors and may become nice alternative for those who need faster solutions than secp521r1.

Refer: https://security.stackexchange.com/questions/78621/which-elliptic-curve-should-i-use

分类: Web安全

0 条评论

发表评论

Avatar placeholder

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据