### Re: [dsfjdssdfsd] provability & Dual_EC ... [was Blum-Blum-Shub ambiguity in 4086 ...]

Dan Brown <dbrown@certicom.com> Tue, 18 March 2014 16:14 UTC

Return-Path: <dbrown@certicom.com>

X-Original-To: dsfjdssdfsd@ietfa.amsl.com

Delivered-To: dsfjdssdfsd@ietfa.amsl.com

Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 39F4A1A06F5 for <dsfjdssdfsd@ietfa.amsl.com>; Tue, 18 Mar 2014 09:14:52 -0700 (PDT)

X-Virus-Scanned: amavisd-new at amsl.com

X-Spam-Flag: NO

X-Spam-Score: -3.888

X-Spam-Level:

X-Spam-Status: No, score=-3.888 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, GB_I_LETTER=-2, HTML_MESSAGE=0.001, LOTS_OF_MONEY=0.001, T_MONEY_PERCENT=0.01] autolearn=ham

Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l8b46cgtkbN9 for <dsfjdssdfsd@ietfa.amsl.com>; Tue, 18 Mar 2014 09:14:33 -0700 (PDT)

Received: from smtp-p02.blackberry.com (smtp-p02.blackberry.com [208.65.78.89]) by ietfa.amsl.com (Postfix) with ESMTP id 22E151A041D for <dsfjdssdfsd@ietf.org>; Tue, 18 Mar 2014 09:14:32 -0700 (PDT)

Received: from xct102cnc.rim.net ([10.65.161.202]) by mhs213cnc.rim.net with ESMTP/TLS/AES128-SHA; 18 Mar 2014 12:14:21 -0400

Received: from XCT111CNC.rim.net (10.65.161.211) by XCT102CNC.rim.net (10.65.161.202) with Microsoft SMTP Server (TLS) id 14.3.174.1; Tue, 18 Mar 2014 12:14:21 -0400

Received: from XMB116CNC.rim.net ([fe80::45d:f4fe:6277:5d1b]) by XCT111CNC.rim.net ([::1]) with mapi id 14.03.0174.001; Tue, 18 Mar 2014 12:14:20 -0400

From: Dan Brown <dbrown@certicom.com>

To: "'joncallas@icloud.com'" <joncallas@icloud.com>, "'dsfjdssdfsd@ietf.org'" <dsfjdssdfsd@ietf.org>

Thread-Topic: [dsfjdssdfsd] provability & Dual_EC ... [was Blum-Blum-Shub ambiguity in 4086 ...]

Thread-Index: Ac9CxQ+6tC49sxKRTUuOfSNE/YvxTA==

Date: Tue, 18 Mar 2014 16:14:20 +0000

Message-ID: <810C31990B57ED40B2062BA10D43FBF5C59E28@XMB116CNC.rim.net>

Accept-Language: en-CA, en-US

Content-Language: en-US

X-MS-Has-Attach:

X-MS-TNEF-Correlator:

x-originating-ip: [10.65.160.251]

Content-Type: multipart/alternative; boundary="_000_810C31990B57ED40B2062BA10D43FBF5C59E28XMB116CNCrimnet_"

MIME-Version: 1.0

Archived-At: http://mailarchive.ietf.org/arch/msg/dsfjdssdfsd/JVEmwoMQE_f8rwP0QrUDc8zlQCs

Subject: Re: [dsfjdssdfsd] provability & Dual_EC ... [was Blum-Blum-Shub ambiguity in 4086 ...]

X-BeenThere: dsfjdssdfsd@ietf.org

X-Mailman-Version: 2.1.15

Precedence: list

List-Id: "The dsfjdssdfsd list provides a venue for discussion of randomness in IETF protocols, for example related to updating RFC 4086." <dsfjdssdfsd.ietf.org>

List-Unsubscribe: <https://www.ietf.org/mailman/options/dsfjdssdfsd>, <mailto:dsfjdssdfsd-request@ietf.org?subject=unsubscribe>

List-Archive: <http://www.ietf.org/mail-archive/web/dsfjdssdfsd/>

List-Post: <mailto:dsfjdssdfsd@ietf.org>

List-Help: <mailto:dsfjdssdfsd-request@ietf.org?subject=help>

List-Subscribe: <https://www.ietf.org/mailman/listinfo/dsfjdssdfsd>, <mailto:dsfjdssdfsd-request@ietf.org?subject=subscribe>

X-List-Received-Date: Tue, 18 Mar 2014 16:14:52 -0000

Hi Jon, Thanks for forwarding your interesting email here. You raise the provability issue about BBS (which is different from the two issues about BBS that I previously raised, which were some attacks), and also extend it to Dual_EC, and perhaps any "public-key" DRBG. Specifically, you say that no public-key DRBG/PRNG can be proved secure. By contrast, BBS claim a security proof (but I have not reviewed the BBS proof at all). Gjosteen and I claim a security proof CRYPTO 2007 for Dual_EC. Therefore, it would be interesting if we could find some common ground. To that end, I've taken some time to write a reactionary missive that I think addresses your concerns. Firstly, the Dual_EC proof is only about its quality as a DRBG, PRNG, or PRG. Specifically, any PRG, including HMAC_DRBG, CTR_DRBG, starts with an initially random fixed length secret seed, maintains a state, and outputs a long stream, with the aim to provide some measure of indistinguishability for the existing outputs even permitting the adversary to access the latest current state. Our claims ignored the threat of state compromise recovery (aka prediction resistance). As usual, a security proof, like any proof, has some hypotheses, and its conclusions are only as a strong as its hypotheses. Also, it is implied by our CRYPTO 2007 paper, that what's required to be initially short secret seed is not only the conventional running state s, but also trapdoor-component of the state log_P(Q). To force log_P(Q) to be random, one can just choose P and Q to be random. To do that, choose them yourself, derived from the same entropy source you needed for the running state, or else choose them as nothing up my sleeve numbers ideally perhaps via NIST SP 800-90A alternative formulation. These techniques help to make log_P(Q) known to nobody at all. If log_P(Q) has been chosen by (or for) you, by some authority, then the Dual_EC, according to the proof, seems secure against everybody but those who know both the running secret state and the value of log_P(Q). Secondly, you also critique of Dual_EC and BBS that the p's and q's themselves need a DRBG to be generated. But then so does any DRBG, once one insists on uniform keys (like conventional security assmuptions for HMAC and AES-CTR usually do). That's what entropy conditioners can help resolve, transitioning from biased raw entropy, to something more like the keys that conventional crypto algorithms usually expect. Also, a variable output-length DRBG is not needed either, because the input states to DRBG are fixed length (with the exceptional of continuously reseeding DRBG). Maybe it's a greater nuisance to generate the public-key DRBG seeds, but I don't see it as some essential obstacle. That all said, I disagree {with /and perhaps even if} the conventional wisdom {that / is} the public-key PRNGs are more secure, by some kind of default. Security should be measured by firstly (a) what attacks are known, and by secondly (b) what the valid proofs claim and assume. It's still on my to-do list to review the security proof for HMAC_DRBG, and see what assumptions it hypothesizes. It is also my hope that the somebody will prove the security of CTR_DRBG, even if in the ideal cipher model (which may be necessary because its backtracking resistance depends on related keys, and most standard assumptions about AES don't involve related keys). As far as I know, there's no fundamental difference in being able to prove security of schemes built from symmetric and asymmetric primitives. The fixed version of Dual_EC (i.e. truncated to 50% of bits per point and "verifiably random" P & Q), the HMAC_DRBG and CTR_DRBG are free from any known attacks. It is also good to have security proofs to complement the lack of attacks. I also sympathize with your general point that security proofs have the danger of dazzling and, thereby, lulling some people into passive acceptance. That's a psychological issue, and I don't have any kind of workaround for it. I think many other people have written lots on the general topic (see Another Look ...). I wonder how much other factors can induce similar effects: implementations, advertising, publication, ... You rightly point out a commonality between some public-key DRBGs, namely Dual_EC and BBS, and their potential for a private key to be abused as a backdoor. That said, some differences between BBS and Dual_EC (only the insufficiently truncated version and backdoored version) include a different in impact upon adversarial knowledge of the private-key-like "trapdoor" (portion of the effective secret state): 1. Given also one output, Dual_EC allows computation of future states (i.e. same consequence as state reveal for any DRBG), and distinguishing of previous past output from random. 2. Given also one running secret state, BBS allows computation of future and past states (and thus outputs). So arguably, the weak version Dual_EC improves on BBS slightly on the narrow aspect of the backtracking resistance: only distinguishing is possible, not computation. (To be fair, though, BBS is better on the aspect of semming to require invasive access to the internal secret state before backtracking.) The significance of this is that (computational) backtracking resistance is helpful, perhaps needed, for forward secrecy. Notice that there seems some growing demand for forward secrecy. This brings me back to my second issue about BBS in my original email on this thread. Again the fully corrected version of Dual_EC does not have any known backtracking vulnerability at all, and like, HMAC_DRBG, even has a security proof (under various reasonable assumptions). Its main disadvantages are being relatively slow, and hard-to-explain differences between the possibly-backdoored version. Best regards, Dan From: dsfjdssdfsd [mailto:dsfjdssdfsd-bounces@ietf.org] On Behalf Of Jon Callas Sent: Monday, March 17, 2014 12:53 PM To: dsfjdssdfsd@ietf.org Cc: Jon Callas Subject: Re: [dsfjdssdfsd] Blum-Blum-Shub ambiguity in 4086 ... I found my missive in question, and upon re-reading it, I think it bears repeating here. The thread starts with <http://www.metzdowd.com/pipermail/cryptography/2014-January/019423.html> and the message I quote from below is <http://www.metzdowd.com/pipermail/cryptography/2014-January/019426.html>. The discussion started with the blog post <http://blog.0xbadc0de.be/archives/155> which purports to show how DUAL_EC_DRBG *must* have been backdoored from the start. That blog post is the antecedent of "it" in the paragraph first paragraph. ---- It's nice work on a technical level, but I think it fails at its goal, that is to be a piece of polemic -- even mischaracterizing the Ferguson/Shumow CRYPTO Rump Session talk (their last slide explicitly said they were not suggesting a back door). Lest you think I'm saying something nice about DUAL_EC_DRBG, I'll repeat what I've said before, "Only an idiot would use it." It's slow, has biases in its output that hashes and ciphers don't, and cannot be proved secure. Let me rewind to the first public key based DRBG/PRNG -- Blum-Blum-Shub. (DRBG is the name NIST gave to what you and I would call a PRNG, it's Deterministic Random Bit Generator. If you think of a complete design of an RNG, you want at least three major sections -- "entropy" collection, entropy pool management, and conditioned output. A DRBG is the output stage.) Blub-Blum-Shub uses an iterated RSA-like operation to generate random bits. It was developed in 1986 and is a brilliant piece of mathematics. It was one of the very, very few bits of early crypto to have a sound theoretical basis. Many people who haven't thought it through have sung its praises over the years, mostly because they got seduced by the sound theoretic basis. Blum-Blum-Shub has two of the three flaws that DUAL_EC_DRBG has: it's slow, and you can't prove it secure. I'm sure you thinking, 'What do you mean, "can't be proved secure? Didn't you just say that it had a sound theoretical basis?"' Yup, and the sound theoretical basis gives you the good mathematical pseudo-randomness of the output. The slow part is pretty obvious. The inobvious part is that it can't be proven secure. As an iterated, RSA-like operation, the core of it is two prime numbers, p and q. The security resolves down to the secrecy of the two primes. And this leaves you with the question of how you get the primes. Well, if you generate them at run time, then you push the construction of your RNG down to the turtle below you. Your random number generator requires random p and q and you get those by using some other random number generator, one presumes. Alternatively, you could use a fixed p and q, and then you have the *exact* flaw as DUAL_EC_DRBG -- you have a fixed private key that can be used to jimmy the thing open. Matt Green wrote a great blog post last week at <http://blog.cryptographyengineering.com>, which you should read. I'll summarize a bit and say that Micali and Shnorr did their own public-key based PRNG which also has Step 1 being "generate large primes p and q" and they helpfully gave test P and Q. I'm not merely being ironic. As someone who implemented the AES-CTR DRBG, having test vectors is really, really nice. NIST's test vectors for that are really, really annoying and I'll complain at length to anyone who cares. Anyway, Matt Green identifies the Micali-Shnorr generator as a precursor to DUAL_EC_DRBG in both design and having a fixed key that you use for whatever purporses, testing or compromise. I have a couple points: (Point 1) Any public-key based PRNG is going to have the issue that either you have a fixed key, or you have to generate a key using some other secure means. This is why I use terms as strong as "can't be proven to be secure" despite having a mathematical "sound theoretical basis." I think there's a huge security philosophy problem here -- security proofs that are mathematical can have underlying engineering assumptions that render them insecure to the point of being silly. I think that people get blinded by this as well, and if there's a mathematical proof they're blinded by it, if not cowed by the math and stop prodding at the engineering and operational security. Going back to Blum-Blum-Shub, look at the Wikipedia article on it at <http://en.wikipedia.org/wiki/Blum_Blum_Shub>. There are some interesting statements there, like the first sentence of the security section: The generator is not appropriate for use in simulations, only for cryptography, because it is very slow. That makes me splutter. As an engineer, I'd argue that slow alone makes it not suitable for cryptography. I'm tempted to argue that for simulations, speed isn't an issue, but really, if you slow things down enough, it's not suitable for anything. I also have a long-standing twitch at *any* security discussion that brings in performance. Performance is not security, and many security sins have their root cause in a performance worry, usually an artificial one. The remainder of the section reads: However, there is a proof reducing its security to the computational difficulty of the Quadratic residuosity problem. Since the only known way to solve that problem requires factoring the modulus, the difficulty of Integer factorization is generally regarded as providing security. When the primes are chosen appropriately, and O(log log M) lower-order bits of each xn are output, then in the limit as M grows large, distinguishing the output bits from random should be at least as difficult as factoring M. If integer factorization is difficult (as is suspected) then B.B.S. with large M should have an output free from any nonrandom patterns that can be discovered with any reasonable amount of calculation. Thus it appears to be as secure as other encryption technologies tied to the factorization problem, such as RSA encryption. This is interesting because nowhere do they address the central engineering issue -- that a fixed p,q is not secure yet a variable one requires another RNG to seed the RNG. Also look at the section in the Handbook of Applied Cryptography on "Cryptographically secure pseudorandom bit generation": <http://books.google.com/books?id=nSzoG72E93MC&lpg=PA185&dq=Cryptographically%20secure%20pseudorandom%20bit%20generation&pg=PA185#v=onepage> We find an RSA-based generator there along with Micali-Shnorr and Blum-Blum-Shub and *all* of these have a recipe that starts unironically with (essentially): 1. Setup. Generate two RSA-like secret primes, p and q. This is a blind spot that's been there forever -- two of the three flaws of DUAL_EC_DRBG have been staring us all in the face since 1986. Despite mathematical brilliance, the security of public-key based PRNGs have always been flawed with something that could be used as a back door. (Point 2) History looks different when you look backwards than when you look forwards. Everyone has a tendency to act as if things were predetermined when we analyze the decisions of the past. We also assign intent when we have to explain a WTF. Yet the usual answer to "What were you thinking?" is "They weren't." To quote the great philosopher David Byrne, "And you might say to yourself, 'My God, what have I done?'" The general flaws have been there forever, and in general we still don't see them. In specific, the documents on Micali-Shnorr and DUAL_EC_DRBG were up front about the flaw all along. Would the NSA exploit such a flaw? Hell, yes. We keep seeing this from leaked documents, over and over. It's clear that they have taken the hacker philosophy that nothing is out of scope or out of bounds to heart as an operating principle. You can see it in the recent ANT toy catalog, as well as the BULLRUN statement that sent us all into a tizzy. We have *assumed* that the BULLRUN statement that they're after damaging standards means that DUAL_EC_DRBG is backdoored. People have said it so loudly and so often that it's part of conventional wisdom now. Yet until BULLRUN, it was part of conventional wisdom that despite the speed problems, mathematics made public key PRNGs more secure. I know that one of my personal blind spots is that I'm a contrarian. I'm also a cynic who believes that stupidity is one of the fundamental forces of the universe. So I find myself in the ironic position of defending a thing I never liked because yes, really, people *can* be that stupid. We all defer to authorities, are cowed by proofs, and lose our critical thinking skills when faced with a standard. I am reminded of Markoff Chaney from Illuminatus! as well as Poe's Purloined Letter. If we want to look at this as a root-cause exercise, we can go back to Blum-Blum-Shub and see the kernel of the flaws and blindness of them. You can see that despite it being there from the start, we didn't *understand* it. You can see the progression through Micali-Shnorr through the ANSI X9 committee, and then on to NIST. I'm left wondering if something can really be a backdoor if it was there all along, we just didn't grok it. Was the purloined letter hidden? I can't help but feel that calling it a back door is just too cheap and easy and convenient. It wasn't that we were collectively stupid and snookered ourselves, it was demons and those in league with them. This leaves the question of what they *have* been doing with that $250M, which is a good question. I lean towards private standards like those used in telecom etc. In the public world, we're good at doing it to ourselves. Jon