Re: [Cfrg] call for review: Deterministic Usage of DSA and ECDSA Digital Signature Algorithms

Dan Brown <> Tue, 25 September 2012 15:24 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id C327C21F845A for <>; Tue, 25 Sep 2012 08:24:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.182
X-Spam-Status: No, score=-2.182 tagged_above=-999 required=5 tests=[AWL=-0.600, BAYES_00=-2.599, EXTRA_MPART_TYPE=1, HTML_MESSAGE=0.001, J_CHICKENPOX_41=0.6, J_CHICKENPOX_42=0.6, MIME_QP_LONG_LINE=1.396, RCVD_IN_DNSWL_MED=-4, SARE_GIF_ATTACH=1.42]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id Q7Qv0Lgk7Jqq for <>; Tue, 25 Sep 2012 08:24:02 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 744DA21F853D for <>; Tue, 25 Sep 2012 08:24:02 -0700 (PDT)
X-AuditID: 0a412830-b7fab6d000006b80-09-5061cc91f135
Received: from ( []) (using TLS with cipher AES128-SHA (AES128-SHA/128 bits)) (Client did not present a certificate) by (SBG) with SMTP id F9.5F.27520.19CC1605; Tue, 25 Sep 2012 15:24:01 +0000 (GMT)
Received: from ( by ( with Microsoft SMTP Server (TLS) id; Tue, 25 Sep 2012 11:24:00 -0400
Received: from ([fe80::fcd6:cc6c:9e0b:25bc]) by ([::1]) with mapi id 14.02.0318.001; Tue, 25 Sep 2012 11:24:00 -0400
From: Dan Brown <>
To: "'David W. Kravitz'" <>, "'Igoe, Kevin M.'" <>, "" <>
Thread-Topic: [Cfrg] call for review: Deterministic Usage of DSA and ECDSA Digital Signature Algorithms
Thread-Index: AQJZjD1WbN3mB22kfgMwgvHZe2e5lAHYBuGklmuTzgCAB1BZIIAAWUCA///I9JCAAJYCgIAA2V8Q
Date: Tue, 25 Sep 2012 15:23:59 +0000
Message-ID: <>
References: <> <> <002801cd96b7$b7c38c80$274aa580$> <> <000601cd9a69$897d3460$9c779d20$> <> <002901cd9a99$070dc870$15295950$>
In-Reply-To: <002901cd9a99$070dc870$15295950$>
Accept-Language: en-CA, en-US
Content-Language: en-US
X-MS-Has-Attach: yes
x-originating-ip: []
Content-Type: multipart/related; boundary="_004_810C31990B57ED40B2062BA10D43FBF50BA17EXMB111CNCrimnet_"; type="multipart/alternative"
MIME-Version: 1.0
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJsWRmVeSWpSXmKPExsXC5bjwrO7EM4kBBlPOKFp0/zjIZNH4aTWr xcZrkxgtJpx6zWpx/99ZVourq/6wO7B5TPm9kdVj8sbDbB7XTv5l9ejf9ZLV49e9fuYA1qgG RpukxJKy4Mz0PH07m8S8vPySxJJUhZTU4mRbJZ/U9MQchYCizLLE5EoFl8zi5JzEzNzUIiWF zBRbJRMlhYKcxOTU3NS8ElulxIKC1LwUJTsuBQxgA1SWmaeQmpecn5KZl26r5Bnsr2thYWqp a6hkp5vQyZMxefsLloLGZUwVi5/dYG9g/N/E1MXIySEhYCKxdMVeKFtM4sK99WxdjFwcQgJ9 TBIvXxxhhXBWMkosnHsDKjOHUeL/3cesIC1sAqoS94+eYwaxRQRqJPpWTGQHKWIWaGWUWH1g F9hcYYEMiaVf3rNDFGVKfJ/6lw3CjpL4c/cRmM0CNGj7iaVAQzk4eAXcJGa2JkIsm8Qssfzr d7BlnAL2Etsu/wOrZxSQldh99jrYfGYBcYlbT+ZD/SAi8fDiaTYIW1Ti5eN/rBC2osT8uZfY II7rZJR4+mAL2EG8AoISJ2c+YQGxhQQUJK5c38cygVF8FpK5s5D1zELSA1GUK7F32xp2CFtH YsHuT2wQtrbEsoWvmWHsMwceM2GK60hsvrQTao6iRFvnbKhlSxkljj+8xwZTNPHvXFaYoind D9kXMPKuYhTMzSg2MDNMzkvWK8rM1ctLLdnECE62GgY7GN+/tzjEKMDBqMTD+21/YoAQa2JZ cWXuIUYJDmYlEV7ZY0Ah3pTEyqrUovz4otKc1OJDjPHASJjILMWdnA/MBHkl8cYGBuRwlMR5 54pGBwgJpAMTeXZqakFqEcwGJg5OkAu4pESKgek4tSixtCQjHpQ14ouBeUOqgbFEs/rd+kMl r5RUyzfttSp87M/0110j6rXMh+T4yW2lRqs4i/dLngmbKnklOJg7idXr9R6BhWdXJfxbxLwk cs7Z29/Oz/7qeXHVQyu/HaLvnhvMCm3N2zPBe+F9s1e5+ldUTl03KJD0msA//ez1N09PbBDa khvf/7S75evjB54TOEJjpjDxNQoqsRRnJBpqMRcVJwIA+QGoYREEAAA=
Cc: "" <>, "" <>, "" <>
Subject: Re: [Cfrg] call for review: Deterministic Usage of DSA and ECDSA Digital Signature Algorithms
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Crypto Forum Research Group <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 25 Sep 2012 15:24:08 -0000

Hi David and CFRG subscribers,

Regarding David's question comparing the security of the HMAC_DRBG method from the I-D to David's simpler HMAC-only proposal, I don't think anybody is saying the HMAC_DRBG method is more secure (though Kevin Igoe mentions that analysis already done on HMAC_DRBG).  My intuition would be that they are about the same security, for what little my intuition is worth.

To further answer David's question, my understanding that one of the intuitive goals of HMAC_DRBG design, which I'm not sure is applicable here, was (a) to have a wider pipe than just HMAC and (b) that as long as HMAC_DRBG is fed enough input entropy the output entropy of its initial segment output is not limited by the security level of HMAC.  (The latter is the "full entropy" notion in 90C).  I'm not sure that I quite understand that goal exactly, or that HMAC_DRBG meets it, but I would hazard a bet that HMAC_DRBG could be secure on an assumption slightly milder than HMAC being PRF, which might be the only advantage of the HMAC_DRBG over the simpler HMAC-only.  Put another way, one might be able to devise a pathological condition on the hash function such that HMAC is not PRF, but HMAC_DRBG is still secure.

The I-D  and I have raised the issue of compliance. (I should clarify myself by saying that I agree the I-D probably complies with 90A. But I think it would be nice to further comply 90C and some of the boundary concepts hinted at in ANSI X9.62-2005 but unfortunately that may not be possible).  That said, given that David's solution is also secure, and more efficient, then maybe it deserves to be standardized (that was my point 7).  David's mention of the key derivation function standard suggests that it could applicable here, as an alternative well-studied method.

Can somebody please articulate the benefit of the feature of having the same signature per message?  Perhaps the I-D itself should elaborate on this point. Is it just that some protocol picked some signature scheme with this deterministic feature, and then the protocol decided to rely on this feature, e.g. by using the signature as an stable index for the message?

Curiously, a randomized ECDSA signature (r,s) can also almost provide stable index for the message m, by computing a message-index of h(m)G = sR - rQ, where R is one a just a few elliptic curve point which can be derived from r (this is similar to how the public key can almost be recovered).

Best regards,

Daniel Brown

Research In Motion Limited


From: [] On Behalf Of David W. Kravitz
Sent: Monday, September 24, 2012 5:10 PM
To: 'Igoe, Kevin M.';
Subject: Re: [Cfrg] call for review: Deterministic Usage of DSA and ECDSA Digital Signature Algorithms

Kevin and all,

In the (EC)DSA application, unlike a DRBG considered in isolation, we need k^-1 mod q and (H(m) + xr) mod q to effectively hide each other when multiplied modulo q and the resultant modular product 's' and r = (g^k mod p) mod q and y = g^x mod p and 'm' are public (as is g^k mod p through reconstruction during signature verification). Unlike applications that actually require a DRBG: (1) it is not a security weakness if k's repeat for the same m's; and (2) we don't need to reconsider the case where an adversary gains a k value through compromise (as opposed to cryptanalysis) since this is (equally) deadly regardless of how k is generated.

So within this particular application (as opposed to DRBG in general) how is the use of HMAC_DRBG in the draft document any more secure than the direct use of HMAC(x, H(m)||Counter), where (for bias handling) Counter increments by one, is reinitialized for each 'm', and its values are completely determined by either FIPS PUB 186-3 B.2.1 (Per-Message Secret Number Generation Using Extra Random Bits)or B.2.2 (Per-Message Secret Number Generation by Testing Candidates)?

As "data points" regarding the security of HMAC: , New Proofs for NMAC and HMAC: Security without Collision-Resistance, has the following "Abstract: HMAC was proved by Bellare, Canetti and Krawczyk (1996) to be a PRF assuming that (1) the underlying compression function is a PRF, and (2) the iterated hash function is weakly collision-resistant. However, recent attacks show that assumption (2) is false for MD5 and SHA-1, removing the proof-based support for HMAC in these cases. This paper proves that HMAC is a PRF under the sole assumption that the compression function is a PRF. This recovers a proof based guarantee since no known attacks compromise the pseudorandomness of the compression function, and it also helps explain the resistance-to-attack that HMAC has shown even when implemented with hash functions whose (weak) collision resistance is compromised. We also show that an even weaker-than-PRF condition on the compression function, namely that it is a privacy-preserving MAC, suffices to establish HMAC is a secure MAC as long as the hash function meets the very weak requirement of being computationally almost universal, where again the value lies in the fact that known attacks do not invalidate the assumptions made."

Although I realize "SHA-3" is coming, with regard to whether/which existing SHA compression functions are PRFs, this is what I found so far: , Pseudorandom-Function Property of the Step-Reduced Compression Functions of SHA-256 and SHA-512, Abstract: "Applications of an iterated hash function such as HMAC require that the compression function of the hash function is a pseudorandom function. However, the pseudorandom-function property of the compression function was not analyzed up to now. This paper shows that it is easy to distinguish between the 22 step-reduced SHA-512 compression function with the key-via-IV strategy and a random function. This is the first result on the pseudorandom-function property of the SHA-512 compression function with the key-via-IV strategy. A similar distinguishing attack is applicable to the SHA-256 compression function with the key-via-IV strategy."

As we know, HMAC is used in, SP 800-108 Recommendation for Key Derivation Using Pseudorandom Functions,  which indicates "For key derivation, this Recommendation approves the use of either the keyed-hash Message Authentication Code (HMAC) specified in [8] or the cipher-based Message Authentication Code (CMAC) specified in [7] as the pseudorandom function." Presumably, the reason why that Special Pub does not recommend the use of a keyed hash function directly (instead of HMAC) is because, in particular, the length-extension property of Merkle-Damgard- based hash functions implies such hash functions do not behave as PRFs even if the underlying compression function behaves as a PRF.


From: Igoe, Kevin M. []
Sent: Monday, September 24, 2012 1:17 PM
To: 'David W. Kravitz';
Subject: RE: [Cfrg] call for review: Deterministic Usage of DSA and ECDSA Digital Signature Algorithms

Hi David:

Thanks for the clarifications.

I have heard reports that some applications (I think it was BGPsec related, but I could easily be wrong),
like the "feature" that  Alice's signature will be the same each time she signs the same message.  (Hopefully
someone more familiar with BGPsec can verify this).

I believe your main concern is the double use of the signer's secret "x" value.   As you point out, we are
"betting the farm" that ALL of the "k"'s produced by the HMAC_DRBG are strong.  I've not seen any reason
to doubt the strength of HMAC_DRBG.

It is  unlikely that we will ever be able to prove this double usage doesn't introduce any security problems .
But I agree with the author that given the extensive analysis of the primitive's involved, the only risk is that
somehow combining the two leads to an exploitable weakness.   I agree with you and the author that this
is double usage unlikely to lead to an exploitable  weakness,  but would like more feedback from the list
on this point.

You're probably right that the use of full blown HMAC_DRBG is overly conservative, but it has the virtue of
having withstood many years of examination.  In an effort to get a design finished in a timely fashion I
suggest that we continue with the existing design.  But I also would strongly encourage you and your co-authors
to put forth a more daring and an efficient alternative design, one that will require more extensive analysis
before it is ready for adoption.

This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.