Re: [CFRG] On the properties of sid in CPace

Filippo Valsorda <> Tue, 13 April 2021 11:56 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 3FFAA3A1200 for <>; Tue, 13 Apr 2021 04:56:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key) header.b=Eeb1FFy2; dkim=pass (2048-bit key) header.b=CzxpCoSo
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id jzg4nvVcT4nj for <>; Tue, 13 Apr 2021 04:56:42 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 44FC73A1205 for <>; Tue, 13 Apr 2021 04:56:42 -0700 (PDT)
Received: from compute3.internal (compute3.nyi.internal []) by mailout.west.internal (Postfix) with ESMTP id 1AAA61A64 for <>; Tue, 13 Apr 2021 07:56:40 -0400 (EDT)
Received: from imap1 ([]) by compute3.internal (MEProxy); Tue, 13 Apr 2021 07:56:40 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm3; bh=7/MwlJzpS8ZwjLLX59gNz0ZOJIoiAtF iYkb9p/SFvIg=; b=Eeb1FFy23VCMiTw/SGBxxzSd69f5PQqQ4EMwkYe69DJRTQx HkjULhvVQtIKklEUn08p/Yj1YujUnD3jogbdwEuhC5D5M8qA2PRUBv+gBR06Qq8L hckm9x+aEncQN1+7+WyMPALeRWPclxjOPTAzMUonyOX9B+lj3Z1RXLYVTJW2xsuu HXsfDHCLMoLlkhuH0NCDJzP2T2aY1XUME7q0/Z66KhZ71xmP++eFtc30ZSznAG5X OCL6rAkfH+OiBB0wa3JHQijRE0qci3VQgYaTiKcARD63AJUHsbwwhBAa+gJw3M1S 2Wu/DZ+Kz4IGU2IsN7BmiuYtT8cSpzNFD/4GLOg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=7/MwlJ zpS8ZwjLLX59gNz0ZOJIoiAtFiYkb9p/SFvIg=; b=CzxpCoSo/Osp+/i/CtBjy3 YMQDSk+w+JGXfg34Pm/jPFaqciBPJkjfrA/czAKc/2WEl4pZ15WsGWh/1viPU8Pr CjRufSloKCvgWZSyg3iZpkv8TF3Xa8ofHHfHBlAufUFGsuiVF6sKyzCX3yJ0NrpL HzCiEUhRziw+h53oL1rWnoIoQKX2/iwaM7nVGpNaqWatIo0QyrJLfxwno2SMUBpq cJuE1Aq1nzQvG0yz0ze/2B2cnNEajnimQChPZYevxqdUOY/qhJPqJK8iSLCATJqs HWARW/hGWVHmTtKeRxXOujkv5a2FSNW99ch6q8mrHHpjocTE9lBt54oSA81iH+dw ==
X-ME-Sender: <xms:9oZ1YPs0oF6Qgoi-nKZqQRKLS_FkmFTmuYa4SrXZ9RXZfYT1QMTFHA> <xme:9oZ1YActKgPfwVrfVfttMRpwz009QSWAkqS44RJCPiQMSy_kQuNE29oz--aYisjZn YpZaisSsio5hN5FSQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudekledggeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsegrtd erreerredtnecuhfhrohhmpedfhfhilhhiphhpohcugggrlhhsohhruggrfdcuoehfihhl ihhpphhosehmlhdrfhhilhhiphhpohdrihhoqeenucggtffrrghtthgvrhhnpeehudffud efkeeugfeifefgtdevteeikeffvedvudegieejteefgffgfeekgeevteenucffohhmrghi nhepihgvthhfrdhorhhgpdhirhhtfhdrohhrghenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehfihhlihhpphhosehmlhdrfhhilhhiphhpohdr ihho
X-ME-Proxy: <xmx:9oZ1YCzOPcmKSBCuAz_jCJ8qvLPRkas_BiRsETrK-W3QTNPAhTBCYQ> <xmx:9oZ1YOO8_7M9pdSrYb9Owd7l42_3CIEeBE7hpPptFpMR_dONfOOpAA> <xmx:9oZ1YP8iH58ETq63UY9DopKpnbx-4SxWdDa3H5alLJ4aeNqTi7WqPQ> <xmx:94Z1YCIkJs0PBqBSTfGrHnEM2WpO77j59Lm8RqL6r4w-MUFQNaCGLQ>
Received: by mailuser.nyi.internal (Postfix, from userid 501) id D3840130005F; Tue, 13 Apr 2021 07:56:38 -0400 (EDT)
X-Mailer: Webmail Interface
User-Agent: Cyrus-JMAP/3.5.0-alpha0-273-g8500d2492d-fm-20210323.002-g8500d249
Mime-Version: 1.0
Message-Id: <>
In-Reply-To: <>
References: <> <> <> <>
Date: Tue, 13 Apr 2021 13:56:16 +0200
From: "Filippo Valsorda" <>
Content-Type: multipart/alternative; boundary=46db420b4db74631a482ab686afd6d4d
Archived-At: <>
Subject: Re: [CFRG] On the properties of sid in CPace
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: Tue, 13 Apr 2021 11:56:48 -0000

2021-04-13 11:38 GMT+02:00 Julia Hesse < <>>:
> Hi Filippo,
>> Do I understand correctly that, in summary, an initiator-selected sid
>> does not meet the uniqueness requirement, so the CPace proof does not
>> cover the protocol currently specified in the draft?
> If the protocol from the draft is used to exchange multiple keys, then non-uniqueness of sid's yields a setting that cannot be covered by the (any) single-session proof plus the composability guarantees of UC. As I said before, it's simply outside the model: while sid collisions in the model never happen because then colluding processes are merged to a single one, a real execution would could have *different* runs of CPace with the same sid.
> It urgently needs to be clarified in the draft whether it proposes only a one-time protocol, and if not under which conditions (i.e., on sid) it can be executed multiple times. 

When you say a "one-time protocol", does that mean executing it only
once per password?

>> There are real world uses for an initiator-selected sid, as it enables
>> 0.5RTT data, so it would be really nice if the proof could be extended.
> The only way I see to make the initiator-chosen sid work is to give the responder means to check uniqueness. That is of course annoying, as we don't want to burden parties with long-term state in an otherwise stateless protocol. 
>> In the meantime, it sounds like CPace should only run after unique
>> values (such as random values with comfortable birthday bounds) have
>> been negotiated from both sides, as I can't think of any other way to
>> provide such a strong uniqueness guarantee.
> I agree. Although I really hope that I am wrong in all this and somebody chimes in to tell me :)
>> From a protocol engineering point of view, I find it more comfortable
>> to think in terms of transcripts, and not have to worry about how sid,
>> identities, and additional data might have different properties and
>> requirements, so I would suggest the following variant
>>     G = map_to_group_mod_neg(DSI1 || PRS || ZPAD || transcript1)
>>     ISK = H(DSI2 || Ks || transcript2) [should there be a ZPAD after Ks?]
>> where transcript1 MUST include unique values from both sides, and
>> transcript2 MUST include transcript1, Yas, and Ybs.
> I have to side with Hugo here: we need to be careful not to obfuscate by assigning more than one reason to a design choice. Ya and Yb are key shares and we should not at the same time use them as nonces. If we need nonces for security reasons, we should introduce them to the protocol. (Obviously, I'm more on the theory side of crypto, so introducing nonces for more security makes me happy.)

Oh, I am not suggesting using Ya and Yb as nonces, like in the original
thread. I am firmly on the engineering side, so if you folks are not
comfortable with it I am not going to mess with it :) I think my
suggestion is the same from a theoretical point of view, and if it isn't
I am failing to understand or explain something.

What I'm saying is that currently any implementer or higher level
protocol designer needs to figure out the difference between sid,
identities, and additional data, and match them with parts of their
protocol. My suggestion doesn't remove or repurpose anything, it just
rewords everything in terms of a protocol transcript and what it must

Instead of hashing sid and CI into G, and maybe the transcript into CI,
it says to hash the whole transcript, and that it must include unique
values from both sides, which means it includes the sid. Then instead
of hashing sid, Yas, and Ybs into ISK, it says to again hash the whole
transcript, which at this point will include the sid values from before
CPace was run, and Yas and Ybs. Yas and Ybs are in transcript2 because
they are already in the draft, not to replace sid.

>> (This implies sending Yas and Ybs on the wire, which raises the question
>> of why the current draft sends Ya and Yb instead. Sending something
>> different from what's hashed in the transcript seems like asking for
>> trouble. Of course none of this would matter for a proper prime order
>> group such as ristretto255...)
>> Besides being IMHO clearer about how to integrate in a protocol, this
>> variant has two other advantages: it encourages the use of transcripts
>> even further, and it eliminates the difference between CI and sid, which
>> is still not clear to me.
> Quick question: what is the difference between Ya and Yas here?

Yas = strip_sign_information(Ya)

It's the x or u coordinate without the sign bit for the other coordinate.

> Thanks for the proposal! We are currently in the process of reviewing the contents of the draft, including revisiting the roles of DSI,CI,sid,party identifiers etc., and we will take your proposal into account. 
> Best,
> Julia
>> What do you think?
>> Cheers,
>> Filippo
>> 2021-04-12 21:51 GMT+02:00 Julia Hesse < <>>:
>>> Dear Filippo,
>>> thank you for opening this topic, which certainly needs discussion. I 
>>> planned to write about sid establishment in general for a while, so I'm 
>>> happy you are finally forcing me :) First, let me try to 
>>> complement/structure some prior information given on this list about 
>>> session identifiers in UC.
>>> From the side of UC, there are 2 requirements on the sid of a protocol 
>>> (for the purpose of this email, it's okay to think of a 2-party key 
>>> exchange protocol):
>>>  (1) uniqueness
>>>  (2) known in advance
>>> Both properties are assumptions made by the UC framework, which is why 
>>> protocols formulated in UC terminology never check uniqueness of the sid 
>>> given to them. It is simply an assumption, meaning that it is not 
>>> possible to model protocol executions with session identifiers are not 
>>> unique or not known in advance. As Ran explained here 
>>> [], 
>>> he chose these mechanisms for the proper modeling of interactive 
>>> processes in dynamic systems.
>>> Okay. But who choses sid's, and how?
>>> Combining both properties, for a two-party protocol our options are 
>>> essentially as follows:
>>> (1) sid is given as input to initiator, the responder obtains the sid 
>>> with the initiator's first message and outputs it to the application.
>>> (2) sid is given as input to both parties.
>>> In both cases, the application needs to ensure uniqueness of the sid for 
>>> proven UC guarantees to hold even if the protocol is executed multiple 
>>> times. For (2), one could let both parties contribute their own 
>>> randomness in an interactive protocol that is run *as part of the 
>>> application*. A non-interactive way is to let both parties' application 
>>> processes derive a unique sid from the application's session's values, 
>>> e.g. sid=(IP-A,IP-B,application-transcript). There might be ways to 
>>> nicely integrate such sid establishment into application protocols 
>>> (e.g., TLS or HTTPS) by piggybacking messages etc., but they all exploit 
>>> properties of the specific application protocol. What I want to say is 
>>> that, imo, there is no way of telling what the best sid establishment 
>>> methods for CPace or OPAQUE are without considering the concrete 
>>> application protocols.
>>> If we want to provide and analyze an application-independent method for 
>>> session identifier establishment, we need to switch to a multi-session 
>>> version of, e.g., key exchange (as hinted by Ran in his post already). A 
>>> practical example of such a multi-session protocol is the DH key 
>>> exchanges within TLS1.3 (essentially, all of them, seen as one single 
>>> protocol execution that runs since the deployment of TLS1.3). Since this 
>>> protocol is started only once and runs during the lifetime of TLS1.3, we 
>>> can simply set sid=DHKE_TLS1.3. In this protocol, it is up to the 
>>> parties to keep track of and distinguish their different attempts to 
>>> exchange keys. Thus, any multi-session key exchange protocol will have 
>>> to incorporate a mechanism to establish unique joint identifiers 
>>> (``sub-session identifiers'') whenever two parties want to exchange a key.
>>> What does this mean for CPace, which is analyzed and drafted as a 
>>> single-session key exchange? Let me try to answer some of your questions:
>>> >
>>> > First, how does the security of CPace degrade upon sid reuse? If it 
>>> > were to
>>> > happen due to birthday bounds, how catastrophic would it be?
>>> >
>>> > What happens if the sid can be attacker-controlled between two 
>>> > otherwise honest
>>> > peers which both know the password?
>>> >
>>> No need to invoke the birthday bound, as it happens already when the 
>>> responder accepts any sid proposed by a malicious initiator (who can of 
>>> course also play man-in-the-middle with same sid on both sides). Note 
>>> that we are now kind of outside the UC model for single-session CPace, 
>>> since in UC sid re-use "merges" CPace instances, while in reality we can 
>>> have different CPace executions with same sids.
>>> To answer your question formally, one would need to consider CPace as 
>>> multi-session protocol. If this protocol has a built-in mechanism to 
>>> keep parties from running different key exchanges with matching sids, I 
>>> would bet that we can just use the same simulation strategy as in 
>>> single-session CPace, to simulate each subsession. If such mechanism is 
>>> missing, it seems the current proof strategy cannot be lifted to 
>>> multiple sessions: it breaks down upon re-use of sid for a pair of 
>>> parties P,P' exchanging two keys from same passwords. The individual 
>>> simulation strategies for those exchanges would attempt to program the 
>>> password hash function at the same point (sid,P,P',pw) to different 
>>> values, and thus fail.
>>> This of course does not imply that there is a meaningful attack on the 
>>> multi-session protocol level (a protocol that has not even been 
>>> specified yet), nor that the conducted single-session proof is flawed. 
>>> It does however suggest that method (1), which is also used in the 
>>> current version of the draft, is not the best choice for single-session 
>>> CPace.
>>> > Is uniqueness its only requirement, or does it also have to be 
>>> > unpredictable?
>>> >
>>> The proof of CPace does not rely on unpredictability. Of course, 
>>> unpredictability could help ensuring uniqueness in a setting where 
>>> multiple single-session CPace executions are spread in a distributed 
>>> system that does not have any other mean for ensuring uniqueness.
>>> Best
>>> Julia
>>> _______________________________________________
>>> CFRG mailing list
>>> <>
>> _______________________________________________
CFRG mailing list
> _______________________________________________
> CFRG mailing list
> <>