{"id":97,"date":"2015-10-31T21:06:44","date_gmt":"2015-10-31T21:06:44","guid":{"rendered":"http:\/\/credelius.com\/credelius\/?p=97"},"modified":"2017-09-17T17:37:57","modified_gmt":"2017-09-17T17:37:57","slug":"why-i-dont-trust-nist-p-256","status":"publish","type":"post","link":"https:\/\/credelius.com\/credelius\/?p=97","title":{"rendered":"Why I don&#8217;t Trust NIST P-256"},"content":{"rendered":"<h2>ECC&#8217;s Importance<\/h2>\n<p>Elliptic Curve Cryptography (ECC) looks like a good alternative and a replacement for a more common RSA dominated one, especially when it comes to devices with &#8220;weak&#8221; CPU&#8217;s, the ones that you can usually find in IoT world.<\/p>\n<p>ECC used to be predominantly proprietary and patented by companies like Certicom, but now there are public standards and implementations that can be used without paying expensive license fees.<\/p>\n<p>The standards have been created by organizations such as Crypto Forum Research Group (CFRG),\u00a0 IETF&#8217;s TLS Working Group (TLS WG) and finally by the governmental standard body &#8211; NIST, which is referred often by other compliance standards such as PCI. It means that if you want to be PCI compliant and use ECC you ought to follow NIST recommendations.<\/p>\n<p>What&#8217;s the problem then? &#8211; you might ask, just go ahead and use the<br \/>\nstandards and its implementations in popular open source tools such as<br \/>\nOpenSSL.<\/p>\n<p>The problem is that I can&#8217;t trust to any of the standard organizations listed above. Why I can&#8217;t trust them and what can be done to make your ECC solution secure in the nearest future is described below.<\/p>\n<p>The abundance of materials related to the topic and its complexity doesn&#8217;t allow making this blog short, so be patient please.<\/p>\n<h2>NIST Curves Drama<\/h2>\n<h3>Actors<\/h3>\n<p>Since I&#8217;ve used the word &#8220;Drama&#8221; in the title, I should probably describe actors. Not all of them are new, e.g. you can easily find popular crypto protocol participants Alice and Bob along with eavesdropper Eve in the Bruce Schnier&#8217;s &#8220;Applied Cryptography&#8221; book published in 1996.<\/p>\n<p>Many things have changed since then, <b>Alice and Bob<\/b> are not just &#8220;protocol participants&#8221; anymore, they have become dangerous cyber criminals\u00a0 plotting something evil, while <b>Eve has become a heroic character <\/b>trying to save the world from these dangerous criminals and their vicious plots.<\/p>\n<p>Eve couldn&#8217;t do much without another <b>heroic character Jerry<\/b> whose job is to make Eve even more successful by embedding back doors to crypto protocols and standards.\u00a0 I think, Eve would fail more often than not without Jerry&#8217;s help if criminals Alice and Bob used the right crypto algorithms and protect their private keys well all the time.<\/p>\n<p>As you probably know already, I didn&#8217;t invent Jerry and new roles myself, <a href=\"https:\/\/eprint.iacr.org\/2014\/571.pdf\">they&#8217;ve been created by the people whose daily job is cryptography<\/a> and who publish their work in serious scientific journals that I could only partially understand. Nevertheless, I think my education in applied math and practical experience\u00a0 are sufficient to understand where they are going to with all that.<\/p>\n<p>From my side I would also add few other actors popular nowadays:<\/p>\n<ul>\n<li><b>Good Samaritan John<\/b> who states often that he has nothing to hide and\u00a0 doesn&#8217;t care much about Eve, Jerry and others alike who never stop spying on him.<\/li>\n<li><b>Seasoned Security Consultant Jim<\/b> who comes to executive meetings often\u00a0 to tell business leaders that &#8220;we can&#8217;t really protect your systems against state-sponsored attacks, so let us not even try and save money for something else&#8221;.<\/li>\n<li><b>Influential Crypto Forum Chair Lars<\/b> whose job is to stay the course, pretend that nothing has happened and save the face of the organization whose almost mandatory advice is used by IETF, its TLS working group, NIST and others.<\/li>\n<li><b>Insignificant Choir<\/b> of crypto forum&#8217;s, TLS&#8217;, IETF&#8217;s memebers,\u00a0 cryptographers and entrenched security engineers who are desperately trying to understand how to deal with all that in the real life (hereafter <b>Choir<\/b>).<\/li>\n<\/ul>\n<h3>Drama Unfolds<\/h3>\n<h4><span style=\"color: black;\"><b><b>Dual_EC_DRBG<\/b><\/b><\/span><\/h4>\n<p>Oddly enough, the drama would not have ever happened if one of Jerry&#8217;s notorious colleagues (we&#8217;ll call him Snow White) had not decided to disclose very interesting and intriguing details about once NIST standard and RSA Bsafe&#8217;s default called <span style=\"color: black;\"><b><b>Dual_EC_DRBG<\/b><\/b><\/span>. The nature of the hack is explained in simple terms <a href=\"http:\/\/blog.cloudflare.com\/how-the-nsa-may-have-put-a-backdoor-in-rsas-cryptography-a-technical-primer\/\">here<\/a>. There are two points &#8211; P1 and P2 on a curve. The first is used to calculate a random value, which is a coordinate x of the production n*P1, where n can be considered as an internal state of the algorithm. P2 is used to change an internal state of the algorithm by calculating the production n*P2 and using its x coordinate as a new state.<\/p>\n<p>As it was demonstrated by <a href=\"http:\/\/rump2007.cr.yp.to\/15-shumow.pdf\">Dan Shumow and Niels Ferguson in 2007<\/a>\u00a0 and <a href=\"https:\/\/www.schneier.com\/blog\/archives\/2007\/11\/the_strange_sto.html\">pointed out by Bruce Schneier<\/a> if there was a dependency between P1 and P2, e.g. if P2 = s*P1, then calculating internal state becomes trivial &#8211; it&#8217;s an x coordinate of s*P1*n, where both P1*n and &#8216;s&#8217; are known to an attacker.<\/p>\n<p>Since a method of P2 selection has never been disclosed, it created suspicions that a backdoor key (see &#8216;s&#8217; above) has existed and was known to the algorithm creator since day one. The same has been confirmed by Snow White. The loop has been closed and NIST had nothing better to do as <a href=\"http:\/\/threatpost.com\/nist-removes-dual-ec-from-draft-guidance-on-rngs\/105643\">removing Dual_EC_DRBG from the standard<\/a>.<\/p>\n<p>The other Snow White&#8217;s revelation was that <a href=\"http:\/\/www.theregister.co.uk\/2013\/12\/21\/nsa_paid_rsa_10_million\/\">RSA got $10M from Jerry&#8217;s employer <\/a>to make Dual_EC_DRBG a default in their crypto library called BSafe that was successfully licensed to many commercial companies for very expensive license fees, so RSA made money from the both compromising their library with a backdoor and telling their customer how secure their solution was. What a wonderful business model! I firmly believe now that not only RSA had the best cryptographers, but very inventive and industrious business leaders as well.<\/p>\n<p>The funny thing about BSafe is that thanks to Seasoned Security Consultant Jim (see above) changing defaults in existing implementations is practically impossible, because nobody wants to spend money to protect their systems against state-sponsored attacks. Remember, &#8220;it&#8217;s impossible&#8221; according to the Jim&#8217;s assessment.<\/p>\n<h4><span style=\"color: black;\"><b><b>NIST P-256<\/b><\/b><\/span><\/h4>\n<p>I think, it&#8217;s good time to talk about NIST P-256 now. There is a reason why this particular curve is given more attention than any other NIST curve:<\/p>\n<ol>\n<li>A good compromise between speed and security (256-bit prime looks about right).<\/li>\n<li>It&#8217;s a default in the latest production version of OpenSSL.<\/li>\n<li>EC arithmetic is optimized in OpenSSL implementation (see enable-ec_nistp_64_gcc_128 flag in OpenSSL config), which increases the speed of algorithms such as ECDHE almost twofold.<\/li>\n<\/ol>\n<p>Looks good, right? Wrong, if you consider the fact that the method how EC parameters have been selected is not quite clear. To be more exact, it was not clear how a <a href=\"http:\/\/safecurves.cr.yp.to\/rigid.html\">seed has been chosen to generate a curve parameter<\/a>.<\/p>\n<p>It means that a statement about P-256 being &#8220;verifiable random&#8221; is simply not true and a D. J. Bernstein&#8217;s note in a TLS WG discussion confirms that and provides a hint about <a href=\"http:\/\/www.ietf.org\/mail-archive\/web\/tls\/current\/msg10321.html\">Jerry&#8217;s employer involvement in this case as well<\/a>.<\/p>\n<p>The common suspicion here is that Jerry has tried many of them until found a weak EC curve that can be exploited in the same way as in <span style=\"color: black;\"><b><b>Dual_EC_DRBG <\/b><\/b>case.<\/span> Since there is an opinion that there might be a <a href=\"https:\/\/www.ietf.org\/mail-archive\/web\/tls\/current\/msg10393.html\">&#8220;spectral weakness&#8221; in ECC<\/a> (check also <a href=\"http:\/\/www.ietf.org\/mail-archive\/web\/cfrg\/current\/msg03952.html\">this<\/a>), that suspicion seems quite plausible. &#8220;Spectral weakness&#8221; means that there is a uniform (?) distribution of weak EC curves that can be eventually found through enumeration in a reasonable time interval.<\/p>\n<p><b>Drama Perpetrators<\/b><b><b><\/b><\/b><\/p>\n<p>Good Samaritan John, Seasoned Security Consultant Jim and Influential Crypto Forum Chair Lars make everything even worse by pushing everyone into the direction of not doing anything. Let me explain why their rhetoric is dangerous and doesn&#8217;t make too much sense to me.<\/p>\n<p>John&#8217;s statement, &#8220;I have nothing to hide from my government&#8221;, is probably OK for personal emails and social media, but it becomes less acceptable, if at all, when John is in a position of protecting a global company&#8217;s secrets. Any international company wants to keep competitors at bay and any government tries to help its major businesses as much as possible. Conflict of interests becomes obvious here and a wise CEO would definitely try to find a replacement for John as soon as possible.<\/p>\n<p>Jim just wants to simplify his own life by ignoring threats coming from a government. The problem with this approach is that if one government can break a system, other governments might find a way of doing the same, as well as well heeled and organized cyber criminals that could be connected to a government. Furthermore, either a government or cyber criminals can create tools and make them available for script kiddies at which point everyone could attack the system.<\/p>\n<p>Finally, my favorite actor <b>Lars<\/b> who knows very well what&#8217;s going on in his organization, who periodically listens to the <b>Choir&#8217;s<\/b>\u00a0 rants, but still pretends that nothing has happened and who doesn&#8217;t want to do anything to rebuild\u00a0 trust to his organization even in the eyes of his own co-chairs. I won&#8217;t write too much about it, I just want to refer to <a href=\"http:\/\/www.ietf.org\/mail-archive\/web\/cfrg\/current\/msg03646.html\">Alyssa Rowan&#8217;s message to a Jerry&#8217;s colleague Kevin<\/a> and <a href=\"https:\/\/www.ietf.org\/mail-archive\/web\/cfrg\/current\/msg03736.html\">Lars&#8217; response to the rant<\/a>.<\/p>\n<p>I won&#8217;t make any conclusion from this story, because I could not formulate it better than co-chair David McGrew\u00a0 did:<\/p>\n<blockquote class=\"tr_bq\"><p>&#8220;The Research Group needs to have chairs that it trusts, and who are trusted by the broader IETF and Internet communities that they work with&#8221;.<\/p><\/blockquote>\n<p>Trust is a keyword here in my view.<\/p>\n<p><b>Drama&#8217;s La Finale<\/b><\/p>\n<p>If you&#8217;ve followed my line of thought to this point, you&#8217;ve probably come to the same conclusion as I already &#8211; there is no anyone who would protect your curves from Jerry:<\/p>\n<ul>\n<li>NIST, CFRG &#8211; dysfunctional and not trusted.<\/li>\n<li>TLS WG &#8211; doesn&#8217;t have enough expertise, relies on CFRG when it comes to cryptography.<\/li>\n<li><b>Choir<\/b> &#8211; not an organization, can&#8217;t really create a standard.<\/li>\n<li><b>John, Jim, Lars<\/b> &#8211; simply do not care or corrupt (remember $10M?), or both.<\/li>\n<\/ul>\n<p>As you see, <b>nobody will protect your curves, except you! <\/b><\/p>\n<h2>What you can do<\/h2>\n<h3>Special and Random Curves<\/h3>\n<p>To simplify our considerations we could divide all curves in two groups &#8211; random and the ones with specially selected domain parameters, e.g. NIST P-256, D.J. Bernstein&#8217;s <a href=\"http:\/\/cr.yp.to\/ecdh.html\">Curve25519<\/a> and <a href=\"http:\/\/eprint.iacr.org\/2014\/526.pdf\">Curve41417 <\/a>are &#8220;special&#8221;, while <a href=\"https:\/\/tools.ietf.org\/html\/rfc5639\">Brainpool<\/a> curves are &#8220;random&#8221;.<\/p>\n<p>An important requirement of Brainpool curves is that the method of parameter&#8217;s selection is clearly defined. It includes seeds that are used for deriving the parameters. They also try avoiding the following threat coming from the &#8220;special&#8221; curves:<\/p>\n<blockquote class=\"tr_bq\"><p>&#8220;The primes selected for the base fields have a very special form facilitating efficient implementation.\u00a0 This does not only contradict the approach of pseudo-random parameters, but also increases the risk of implementations violating one of the numerous patents for fast modular arithmetic with special primes&#8221;<\/p><\/blockquote>\n<p>This requirement creates a certain &#8220;nothing up my sleeves&#8221; assurance, which is very important considering lack of trust to manually crafted curves especially when Jerry and his colleagues are involved.<\/p>\n<p>Even though optimized EC arithmetic is not available for the random curves, &#8220;nothing up my sleeves&#8221; factor seems to be more important and it very much determines my personal choice.<\/p>\n<h3>Implementation<\/h3>\n<p>Since in the most cases you&#8217;re not going to build an isolated crypto-system, it&#8217;s important to integrate your crypto libraries with existing system software such as Apache, Tomcat, JBoss, RoR, HAProxy and other web and application servers that you might use.<\/p>\n<p>All of them use OpenSSL to do cryptography and that&#8217;s why using Brainpool curves will require an OpenSSL version that supports them. You could find the curves implemented in the OpenSSL version 1.0.2, but it&#8217;s still a beta that you probably don&#8217;t want to use in production.<\/p>\n<p>My solution was to backport Brainpool curves to a stable version 1.0.1. It was not trivial, but doable. The patch against 1.0.1j is provided in the &#8220;Appendix A&#8221;.<\/p>\n<p>After the new version is created you can statically link it with a web server of your choice.<\/p>\n<p>You should also keep in mind that when it comes to SSL\/TLS implementation, there is a possibility to use different curves for digital signature (ECDSA) and ephemeral key exchange (ECDHE).<\/p>\n<p>The type of curve used for ECDSA is the one that is used as your server&#8217;s private key, while ECDHE curve should be provided as a parameter in a server configuration file, e.g. <a href=\"http:\/\/cbonte.github.io\/haproxy-dconv\/configuration-1.5.html#5\">&#8216;ecdhe&#8217; parameter in &#8216;bind&#8217; command<\/a> of HAProxy config. Please notice that NIST P-256 is a default there, just like it is in OpenSSL. I&#8217;m just saying &#8230; \ud83d\ude42<\/p>\n<p><a href=\"http:\/\/httpd.apache.org\/docs\/2.4\/mod\/mod_ssl.html\">To configure Apache<\/a> you can use SSLCertificateFile option that points to a certificate file containing EC parameters generated by &#8216;openssl ecparam&#8217; command. If you want to use brainpoolP256r1curve, you&#8217;ll need to run:<\/p>\n<blockquote class=\"tr_bq\"><p>\u00a0openssl ecparam -name brainpoolP256r1 -out bp_params.pem<\/p><\/blockquote>\n<p>and then copy\/paste the output to your certificate file.<\/p>\n<h3>Certificates<\/h3>\n<p>To use a Brainpool curve for signatures (ECDSA) you would need to generate a private key and then either use it for creating a self-signed certificate or a CSR file if you want your certificate to be signed by a known certificate authority (CA).<\/p>\n<p>The problem with the latter case is that big CA&#8217;s such as Symantec\/Verisign might not support Brainpool curves (<a href=\"http:\/\/www.darkreading.com\/risk\/symantec-verisign-expands-encryption-options-for-ssl-digital-certificates\/d\/d-id\/1139140?\">even NIST curves support is relatively new for them<\/a>). I didn&#8217;t check smaller CA&#8217;s yet, so there is a room for research.<\/p>\n<p>Generating a private key is simple for a curve, you just need to use the same &#8216;openssl ecparam&#8217; command:<\/p>\n<blockquote class=\"tr_bq\"><p><span style=\"font-size: xx-small;\"><span style=\"font-family: 'Courier New',Courier,monospace;\">openssl ecparam -name brainpoolP256r1 -genkey -out bp_key.pem\u00a0 \u00a0 <\/span><\/span><\/p><\/blockquote>\n<p>After this is done, you can generate a self-signed certificate or a CSR file just like you did it in RSA case, e.g. to create a certificate run:<\/p>\n<blockquote class=\"tr_bq\"><p><span style=\"font-size: xx-small;\"><span style=\"font-family: 'Courier New',Courier,monospace;\">openssl req -new -x509 -key bp_key.pem -out cert.pem <\/span><\/span><\/p><\/blockquote>\n<h3>Brainpool security considerations<\/h3>\n<p>I&#8217;ve noticed when was going\u00a0 through <a href=\"http:\/\/safecurves.cr.yp.to\/\">DJB&#8217;s SafeCurves pages<\/a> that there was one problem called &#8220;Twist Security&#8221;, which didn&#8217;t look good for my choice (brainpoolP256r1):<\/p>\n<table style=\"width: 100%px;\" border=\"1\" cellspacing=\"2\" cellpadding=\"3\">\n<tbody>\n<tr>\n<th>Curve<\/th>\n<th>Cost for twist rho above 2^100?<\/th>\n<th>Cost for twist rho<\/th>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>brainpoolP256t1<\/td>\n<td>2^44.0<\/td>\n<td>2^44.0<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Since security of brainpoolP256r1 is equivalent to its quadratic twist brainpoolP256t1, I was concerned a bit and went through different attacks that DJB described in the <a href=\"http:\/\/safecurves.cr.yp.to\/twist.html\">&#8220;Twist Security&#8221;<\/a> section. The first was small-subgroup attack, which is simply not applicable to Brainpool curves due a requirement of having cofactor equal to 1.<\/p>\n<p>The other two attacks are not relevant either when it comes to OpenSSL implementation, because the latter is compliant with X9 standards, which require a point-on-curve validation.<\/p>\n<p>Just to be sure that it&#8217;s true for OpenSSL, I&#8217;ve checked the code and found EC_POINT_is_on_curve (see ec_lib.c module), which is called each time when a new EC point arrives.<\/p>\n<p><a href=\"http:\/\/www.ietf.org\/mail-archive\/web\/tls\/current\/msg14551.html\">I&#8217;ve even had a good conversation about that with TLS community<\/a> and didn&#8217;t see any objections to what I found so far.<\/p>\n<p>I didn&#8217;t see any other considerations that would say that there is a serious weakness in this curve.<\/p>\n<h2>Conclusion.<\/h2>\n<ol>\n<li>Nobody will protect your curves except you.<\/li>\n<li>Standard bodies are either not trusted or not efficient, or both.<\/li>\n<li>Defaults are dangerous and can contain a backdoor.<\/li>\n<li>Using random curves creates a certain level of assurance that there is &#8220;nothing up Jerry&#8217;s sleeves&#8221; and &#8220;first person attack&#8221; is not possible.<\/li>\n<\/ol>\n<h2>Comments deleted by Google.<\/h2>\n<p>Initial post has been published @ blogger.com, but since Google keeps deleting comments, I moved the blog to this site. Here are screen shorts that blogger.com has deleted.<\/p>\n<p><a href=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2015\/10\/jerome-1027.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-101\" src=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2015\/10\/jerome-1027-300x207.png\" alt=\"jerome-1027\" width=\"300\" height=\"207\" srcset=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2015\/10\/jerome-1027-300x207.png 300w, https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2015\/10\/jerome-1027-1024x706.png 1024w, https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2015\/10\/jerome-1027.png 1502w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>A very interesting fact\u00a0disclosed by\u00a0a member of cryptography research community Jerome Circonflexe is that &#8220;situation with DUAL_EC_DRBG was totally obvious to researchers at the time when it was published&#8221;. It raises even more questions. If it was known from day one\u00a0(year 2007)\u00a0why nobody in that community including very influential CRFG had done\u00a0anything to remove the scandalous standard from NIST? Everybody was\u00a0silent until Snowden came with his stunning revelations.\u00a0Is it a CRFG&#8217;s conspiracy\u00a0(with Jerry&#8217;s employer), intimidation, or indifference to the public interests and to all the people who\u00a0rely on the standard? I think, in any case they owe explanations and an apology to all of us.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'Droid Serif', Georgia, serif; font-size: 21px; line-height: 1.4;\">Appendix A &#8211; Brainpool Backport Patch<\/span><\/p>\n<p><a href=\"http:\/\/gryb.info\/bp_patch.txt\">I&#8217;ve created a patch for back-porting Brainpool<\/a> curves from 1.0.2 (beta) to 1.0.1j (stable). Since I didn&#8217;t change any algorithm, but simply added barinpoolP256r1 parameters, a probability that I broke anything is negligibly small.<\/p>\n<p>I&#8217;ve tested the patched version, which I call 1.0.1z, standalone and with 1.0.2. using the latter as a server. I&#8217;ve even statically compiled it with HAProxy and was able to terminate SSL using the curve for both ECDSA and ECDHE algorithms. Everything worked, no surprises have been found so far.<\/p>\n<p>After you apply the patch and build your 1.0.1z version with brainpoolp256r1 in it you can verify that everything was correct by running<\/p>\n<blockquote class=\"tr_bq\"><p><span style=\"font-size: x-small;\"><span style=\"font-family: 'Courier New',Courier,monospace;\">$ path-to-custom-openssl version<br \/>\nOpenSSL 1.0.1z 15 Oct 2014<br \/>\n$ path-to-custom-openssl ecparam -list_curves | grep brain<br \/>\nbrainpoolP256r1: RFC 5639 curve over a 256 bit prime field<br \/>\n<\/span><\/span><\/p><\/blockquote>\n<h2>Appendix B &#8211; Optimized NIST P-256 speed<\/h2>\n<p>I&#8217;ve tested NIST P-256 speed with optimized EC arithmetic (enable-ec_nistp_64_gcc_128) and compared it with that of the Brainpool curve. The optimized NIST curve was 2x times faster for ECDHE and ECDSA\/signing operations, but was about the same for ECDSA\/signature verification. An absolute benefit was around 0.1-0.2 millisecond per operation.<\/p>\n<p>I don&#8217;t think that it&#8217;s an important denominator. I&#8217;m also suspicious about optimized EC arithmetic, because if it can be optimized by an implementer, brute forcing can be probably optimized by an attacker as well, which can decrease a cost of an attack. It&#8217;s not something that has been proven, just a &#8220;common sense&#8221; reasoning.<\/p>\n<p>Finally, I think, a peace of mind and a confidence that a &#8220;first person attack&#8221; is not possible is a huge benefit compare to 0.1-0.2 millis per operation. The results are below:<\/p>\n<p><span style=\"font-size: xx-small;\"><span style=\"font-family: 'Courier New',Courier,monospace;\">$ openssl version<br \/>\nOpenSSL 1.0.1z 15 Oct 2014<\/span><\/span><\/p>\n<p>NIST curve 2x times faster for ECDH<\/p>\n<p>$ openssl speed ecdhp256 ecdhbp256<br \/>\nDoing 256 bit\u00a0 ecdh(nistp256)&#8217;s for 10s:<br \/>\n71830 256-bit ECDH ops in 10.00s<br \/>\nDoing 256 bit\u00a0 ecdh(brainpoolP256r1)&#8217;s for 10s: 30885 256-bit ECDH ops in 10.00s<br \/>\nOpenSSL 1.0.1z 15 Oct 2014<br \/>\nbuilt on: Sat Nov 15 13:46:22 PST 2014<br \/>\noptions:bn(64,64) rc4(ptr,char) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx)<br \/>\ncompiler: cc -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM<br \/>\nop\u00a0\u00a0\u00a0\u00a0\u00a0 op\/s<br \/>\n256 bit ecdh (nistp256)\u00a0\u00a0 0.0001s\u00a0\u00a0 7183.0<br \/>\n256 bit ecdh (brainpoolP256r1)\u00a0\u00a0 0.0003s\u00a0\u00a0 3088.5<\/p>\n<p>NIST curve is about the same speed for signing<br \/>\nNIST curve is 2x times faster for signature verification<\/p>\n<p>$ openssl speed ecdsap256 ecdsabp256<br \/>\nDoing 256 bit sign ecdsa&#8217;s for 10s: 108757 256 bit ECDSA signs in 10.00s<br \/>\nDoing 256 bit verify ecdsa(nistp256)&#8217;s for 10s: 50898 256 bit ECDSA verify in 10.00s<br \/>\nDoing 256 bit sign ecdsa&#8217;s for 10s: 91873 256 bit ECDSA signs in 10.00s<br \/>\nDoing 256 bit verify ecdsa(brainpoolP256r1)&#8217;s for 10s: 25161 256 bit ECDSA verify in 10.00s<br \/>\nOpenSSL 1.0.1z 15 Oct 2014<br \/>\nbuilt on: Sat Nov 15 13:46:22 PST 2014<br \/>\noptions:bn(64,64) rc4(ptr,char) des(idx,cisc,16,int) aes(partial) idea(int) blowfish(idx)<br \/>\ncompiler: cc -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM<br \/>\nsign\u00a0\u00a0\u00a0 verify\u00a0\u00a0\u00a0 sign\/s verify\/s<br \/>\n256 bit ecdsa (nistp256)\u00a0\u00a0 0.0001s\u00a0\u00a0 0.0002s\u00a0 10875.7\u00a0\u00a0 5089.8<br \/>\n256 bit ecdsa (brainpoolP256r1)\u00a0\u00a0 0.0001s\u00a0\u00a0 0.0004s\u00a0\u00a0 9187.3\u00a0\u00a0 2516.1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ECC&#8217;s Importance Elliptic Curve Cryptography (ECC) looks like a good alternative and a replacement for a more common RSA dominated one, especially when it comes to devices with &#8220;weak&#8221; CPU&#8217;s, the ones that you can usually find in IoT world. ECC used to be predominantly proprietary and patented by companies like Certicom, but now there [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=\/wp\/v2\/posts\/97"}],"collection":[{"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=97"}],"version-history":[{"count":8,"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions"}],"predecessor-version":[{"id":205,"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions\/205"}],"wp:attachment":[{"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}