Re: [Cfrg] I-D Action: draft-irtf-cfrg-spake2-08.txt

"Paterson Kenneth" <kenny.paterson@inf.ethz.ch> Wed, 13 March 2019 15:05 UTC

Return-Path: <kenny.paterson@inf.ethz.ch>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B53AD130E9B for <cfrg@ietfa.amsl.com>; Wed, 13 Mar 2019 08:05:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.999
X-Spam-Level:
X-Spam-Status: No, score=-4.999 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_HI=-5, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 nS4wVIWPT_0H for <cfrg@ietfa.amsl.com>; Wed, 13 Mar 2019 08:04:58 -0700 (PDT)
Received: from edge20.ethz.ch (edge20.ethz.ch [82.130.99.26]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F13D612D4E6 for <cfrg@ietf.org>; Wed, 13 Mar 2019 08:04:57 -0700 (PDT)
Received: from CAS21.d.ethz.ch (172.31.51.111) by edge20.ethz.ch (82.130.99.26) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 13 Mar 2019 16:03:45 +0100
Received: from MBX117.d.ethz.ch ([fe80::c1d4:d225:fabf:1974]) by CAS21.d.ethz.ch ([fe80::55ba:c4a5:d8a7:ab62%10]) with mapi id 14.03.0439.000; Wed, 13 Mar 2019 16:01:35 +0100
From: Paterson Kenneth <kenny.paterson@inf.ethz.ch>
To: Greg Hudson <ghudson@mit.edu>, Benjamin Kaduk <kaduk@mit.edu>
CC: "cfrg@ietf.org" <cfrg@ietf.org>, "cawood@apple.com" <cawood@apple.com>
Thread-Topic: [Cfrg] I-D Action: draft-irtf-cfrg-spake2-08.txt
Thread-Index: AQHU2Cx0BfbR89M7N02t2s+AosM+i6YHVDEAgAGIp4CAAA91gIAAakKAgAA/nQCAAAP9gA==
Date: Wed, 13 Mar 2019 15:01:33 +0000
Message-ID: <6F281044-7E9B-4055-A311-881BBF1D8BE3@inf.ethz.ch>
References: <155232379553.23186.8764563590660883823@ietfa.amsl.com> <884f593b-0753-16ff-e68c-990acd0e8d68@mit.edu> <20190313034352.GE8182@kduck.mit.edu> <7fa7713b-94da-da7b-bf9e-465627a8f030@mit.edu> <135A8573-53DF-4B51-A9F2-E3783DD6A0D0@inf.ethz.ch> <fcb6ac2e-2a0c-3eb3-dbf5-0624596d9f20@mit.edu>
In-Reply-To: <fcb6ac2e-2a0c-3eb3-dbf5-0624596d9f20@mit.edu>
Accept-Language: de-CH, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [129.132.139.36]
Content-Type: text/plain; charset="utf-8"
Content-ID: <7D7BEBE0CA1B5B4EBDD71D028641B6F0@intern.ethz.ch>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/H7ACuZux6BrxcrNaxwW913GdYOU>
Subject: Re: [Cfrg] I-D Action: draft-irtf-cfrg-spake2-08.txt
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Mar 2019 15:05:09 -0000

In-line...

-----Original Message-----
From: Greg Hudson <ghudson@mit.edu>
Date: Wednesday, 13 March 2019 at 14:47
To: Paterson  Kenneth <kenny.paterson@inf.ethz.ch>, Benjamin Kaduk <kaduk@mit.edu>
Cc: "cfrg@ietf.org" <cfrg@ietf.org>, "cawood@apple.com" <cawood@apple.com>
Subject: Re: [Cfrg] I-D Action: draft-irtf-cfrg-spake2-08.txt

    On 3/13/19 6:59 AM, Paterson  Kenneth wrote:
    > 		page 3:  "B stores L=w1*g and w0." (In the context of SPAKE2+.)
    > 
    > 		[...]
    > 
    > 	-- Assuming g is the generator of G of order p*h, notice that this element L is not necessarily in the order p subgroup of G, since w1 (and w0) are not necessarily multiples of h.
    
    Since L is a multiple of G, it will be of order p (since G is of order
    p).  Unless I'm badly mistaken?
   
G is not of order p (at least that's how I read the spec.) - rather it has order hp. See Section 3.1:

	Suppose G has order p*h where p is a large prime; h will be called the cofactor.

    > Later in the protocol, A computes V = w1(Y-w0*N) where Y should have been received from B. If Y is chosen adversarially, then V may also not be in the order p subgroup of G.
    
    I hadn't looked too closely at SPAKE2+.  This step does seem problematic
    because w1 is not a scaled coefficient, and I agree that it does not sit
    well with the security considerations text (which I think was written
    when the draft didn't cover SPAKE2+).  Following the same logic as your
    analysis (except in regard to L), it probably doesn't lead to a
    small-subgroup attack since the attacker cannot see V and cannot easily
    make Y-w0*N be of small order.  But it may invalidate the security proof
    because it's easy for an attacker to make V be of order 2p, 4p, ..., hp.

Right.
    
    I'm not sure I'm qualified to suggest a fix, but I would probably start
    with making w1 a scaled coefficient (however it's generated mod p,
    multiply it by h so that it's in the range [0,ph) mod h, similar to x
    and y).  Although this is asymmetric with w0, note that w0 is used just
    like w in SPAKE (multiplied by M or N to produce a mask), while w1 is
    used similarly to x or y (multiplied by the generator or the other
    party's point).

My intuition here is that we need to be very careful, and (without my chair's hat) I would not want CFRG to finalise an RFC on scheme until we are sure we have a proof that applies to the protocol as specified.

Cheers

Kenny