Re: [Cfrg] Using ephemeral DH in lieu of fresh nonces

Loup Vaillant-David <> Mon, 22 June 2020 15:21 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 8F6063A0D93 for <>; Mon, 22 Jun 2020 08:21:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id N8TRp-nBNUxV for <>; Mon, 22 Jun 2020 08:21:55 -0700 (PDT)
Received: from ( []) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 767143A0BF1 for <>; Mon, 22 Jun 2020 08:21:55 -0700 (PDT)
Received: from grey-fade ( []) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: loup) by (Postfix) with ESMTPSA id 297D83DA1; Mon, 22 Jun 2020 17:11:43 +0200 (CEST)
Message-ID: <>
From: Loup Vaillant-David <>
To: Hugo Krawczyk <>, "<>" <>
Date: Mon, 22 Jun 2020 17:21:52 +0200
In-Reply-To: <>
References: <> <>
Content-Type: text/plain; charset="UTF-8"
X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
Archived-At: <>
Subject: Re: [Cfrg] Using ephemeral DH in lieu of fresh nonces
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Crypto Forum Research Group <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 22 Jun 2020 15:21:58 -0000

Hi Hugo,

Thank you so much for your response, it forced me to change my mind on
a couple points.

How using a primitive for several purposes was new to me. Now I need to
re-consider the design of Monokex, my Noise-like protocol framework
(Noise is amazing, but I felt it could be further simplified): both
framework use ephemeral keys as nonces. The Noise specifications
insists that no party shall send encrypted stuff before they mix their
own ephemeral key in the key mix.

Composition attacks also make my head hurt, so squashing them simply
with a session id sounds like a good safety belt, in case I design a
brittle protocol that would otherwise be vulnerable.


On Mon, 2020-06-22 at 11:01 -0400, Hugo Krawczyk wrote:
> In the email below, Loup raises a natural question: Why not reuse
> ephemeral DH values in a protocol instead of fresh nonces?
> Formalisms apart, fresh non-repeating session identifiers are
> essential for many reasons: against replay attacks, for binding
> session flows together, avoiding  "composition attacks" (e.g., where
> flows from different sessions are mixed-and-matched), ensuring domain
> separation, etc. A natural implementation of session id's uses
> session-specific fresh random nonces. An equally natural question
> (and I think your email was referring to this issue) is why not use
> the ephemeral DH in lieu of random nonces, after all these values are
> selected as fresh random values for each session. 
> A generic reason (which I strongly advocate) for not doing so is that
> one should avoid having the same element in the protocol to serve 
> two separate functionalities/roles (in this case it would be using a
> DH value as key share and also as nonce/sessionid). This results in
> fragile protocols that can easily go wrong with variants of the
> protocol or when the protocol evolves over time, and is prone to bad
> implementations. For example, if one of the roles of this element is
> not  required anymore (due to changes in the protocol or changes in
> the setting where the protocol operates), the element may be changed
> "without remembering" that it had this other role. 
> Concretely, in the case of using ephemeral DH values for freshness,
> there are good practical examples where security breaks with the dual
> use of these values. For example, an application may decide (e.g.,
> for performance reasons) that they do not need "perfect" forward
> secrecy, but that a one-minute forward-secrecy window of repeated
> ephemeral DH values is enough for the application. With repeated DH
> values used as session ids, the uniqueness of the session id is
> gone.  This is also the case of applications that need to avoid
> forward secrecy at all (see requests for a static version of TLS 1.3
> in the TLS mailing list). Yet another example is the SIGMA-I protocol
> (used in TLS 1.3 and IKEv1). If the initiator sends g^x in the first
> message, this value can be used against replay attacks in the
> responder's signature. Then, someone decides (and there may be good
> reasons for that) to send g^x only in the third message and you lose
> your anti-replay mechanism.
> Mea culpa: I have used ephemeral DH values in the dual functionality
> of key shares and session identifiers in several of my papers for the
> sake of analysis/notation simplicity. But you should not do it when
> building real-world implementations. In the SIGMA instantiation in
> draft-krawczyk-cfrg-opaque, for example, nonces are used in addition
> to DH values. (See also appendix B of 
> )
> Hugo