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

Eike Kiltz <ekiltz@gmail.com> Tue, 26 March 2019 14:21 UTC

Return-Path: <ekiltz@gmail.com>
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 8E0A3120319 for <cfrg@ietfa.amsl.com>; Tue, 26 Mar 2019 07:21:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
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_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 CYTJ_1NNjsMe for <cfrg@ietfa.amsl.com>; Tue, 26 Mar 2019 07:21:46 -0700 (PDT)
Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 96968120331 for <cfrg@ietf.org>; Tue, 26 Mar 2019 07:21:18 -0700 (PDT)
Received: by mail-io1-xd2c.google.com with SMTP id u12so10898497iop.11 for <cfrg@ietf.org>; Tue, 26 Mar 2019 07:21:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=wPhLeVzAoQo6s57hJbLm7usrVtVwhVMidp88cz9oE3A=; b=izUICZF3yzzQyWAOslpckKIJOWIn1yHbfbfeUvnRc9CHSJtXcCcs9apCW1M/WjcdUy dxWH1rOOYhguxfqjADFV8ni1feP3MaDKF6hYxr6VssMUv6fabmhKQpmaaDdW54aUu2lm OVDSFM2xgXhOw5XRO2uIHAQA17fAmxE3+Rj+cQJohZBr0z3RULmpyUQoZBSdrTuMOwDf cw8SWGRQuQxGNlr2QNZJh8kVMZm+HsjbXAxCUvAu9MNnElLdJ5u3vHshX+R9BFoAET5l FB6h22Hd3Fr8rfj+5ddg70tcaSeNh5JypVb7gkqn3IDzAQB+xTXP4emNNVqv46kKSfd6 qCVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=wPhLeVzAoQo6s57hJbLm7usrVtVwhVMidp88cz9oE3A=; b=YR3qta7fcXO3BBye8mRZ8VAO+62vXSzrvlHVdl1KmbdSPPHHHiNC7k1OuztIMOpKrI Z544OnD+qht0Q/rhUYPhq3tzrUCLzeRD3TgeJPCLfcaFZ4YkHQWA/d6ZYT4Tc2oG2CKJ NY92b73a/c6kX+98GzoFqUARnh6FcPzxo0FaWjgP1njm2VjaZLBHT3iKHIj7q5Ql6xzj gAnTieeXSJvtSFAgi2LPPkW9yTdMSpLXjow/nwk9uiDhdcbHy5K8lgaV2e/loEdszD5w 4dp8a67XkGa8DnRiwpIBF8BFVmr3xa5TgT/x81iuCTz45uHgdNSdRq1zYqZdDC6trHvm Nogg==
X-Gm-Message-State: APjAAAWMkyGm9bUbZVpi1ddW3VcEK1igOgdxS/uWGkksdWQl+gB2BGL7 VHETJR0YJowmdQJ7G2CPDVtvJBJDWb6FsEJKA9I=
X-Google-Smtp-Source: APXvYqzf5o5pFTtIHDv46UVsQ2scuPKoex0Gpl/KCisdOB4sgBgrimiiVb7G48bnS/EJS+0dTaOvHiqI1mcJnQWgD74=
X-Received: by 2002:a5d:940c:: with SMTP id v12mr3846943ion.32.1553610077654; Tue, 26 Mar 2019 07:21:17 -0700 (PDT)
MIME-Version: 1.0
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> <A8777535-C0C7-48D7-8238-D564F07D3860@apple.com> <dd1e2593-48c5-9f3e-15c7-3b08cef18b89@mit.edu> <CAKt=43ph-7hr3fDmJaaR7hdcmh24Zdor2v5p-9F8MEAhhTHsnA@mail.gmail.com>
In-Reply-To: <CAKt=43ph-7hr3fDmJaaR7hdcmh24Zdor2v5p-9F8MEAhhTHsnA@mail.gmail.com>
Reply-To: eike.kiltz@rub.de
From: Eike Kiltz <ekiltz@gmail.com>
Date: Tue, 26 Mar 2019 15:21:06 +0100
Message-ID: <CAKt=43pSYPdq+P-eNbhNxikZs4yft6rdZGbsjv=o16PTZFCTuA@mail.gmail.com>
To: Greg Hudson <ghudson@mit.edu>
Cc: Chris Wood <cawood@apple.com>, cfrg@ietf.org
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/b1hIQguoaqLw2ioLsBHll06AglI>
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: Tue, 26 Mar 2019 14:21:49 -0000

I had a closer look and using scaled coefficients for x, y and w1
solves the "subgroup issued" in SPAKE2+, see my technical
explanation below.

 -Eike

----------------------------------------
Setup: G is a group of order p*h. P, N, M are generators of the
prime-order subgroup Gp of order p, h is the (small) co-factor.
Let (w0 || w1) be the output of H(pw), where w0 and w1 are
interpreted as numbers in Zp.

Define w1' := h*w1

The idea of the "scaled SPAKE2+" protocol is to substitute x by x':=x*h,
y by y':=y*h and w1 by w1':=w1*h.

The modified protocol between A(w0, w1':=w1*h) and B(w0, L'=w1'*P)
works as follows
1. A picks random x from Zp, defines x':=h*x, computes X:=x'*P+w0*M
and sends X to B
2. B picks random y from Zp, defines y':=h*y, computes Y:=y'*P+w0*N
and sends Y to A
3. A computes Z:=x'*(Y-w0*N), which equals x'y'*P in an honest execution.
    A computes V:=w1'*(Y-w0*N), which equals w1'y'* in an honest execution.
4. B computes Z:=y'*(Y-w0*M), which equals x'y'*P in an honest execution.
    B computes V:=y'*L, which equals w1'y'* in an honest execution.

The problem is that the security argument of [TDH] assumes
X and Y to be in the prime-order subgroup but in general they
can be (adversarially chosen) arbitrary group elements.

Let's look at the case of Y which is the slightly more difficult
case since one has to consider Z and V. A computes from
Y the elements Z and V as
      Z:=x'*(Y-w0*N) = x*h*(Y-w0*N) = x*h*Y - x*h*w0*N
Multiplication by the co-factor h annihilates all parts of Y which
are not contained in the prime-order subgroup Gp. Hence we
can assume wlog that Y is contained in the subgroup Gp since
all other parts are ignored by the protocol.

Exactly the same argument also holds for
     V:=w1'*(Y-w0*N) = w1*h*Y - w1*h*w0*N
----------------------------------------

On Thu, Mar 14, 2019 at 11:58 AM Eike Kiltz <ekiltz@gmail.com> wrote:
>
> I'm one of the authors of [TDH] and I'm happy to see that our ideas
> are considered for inclusion into the PAKE standard.
>
> If I understand correctly, then the group proposes to use "scaled
> coefficients" x and y in the SPAKE2 protocol to
> avoid subgroup attacks. That is, replace any appearance of x and y in
> the protocol with x*h and y*h, respectively.
> This way the "algebraic key" K is forced to be in the prime-order sub-group.
>
> My understanding is that the same argument can be applied to the
> SPAKE2+ protocol by using scaled coefficients
> x, y, and w1. (w0 does not have to be scaled.)
>
> I will have a closer look.
>
>  -Eike
>
> On Wed, Mar 13, 2019 at 6:42 PM Greg Hudson <ghudson@mit.edu> wrote:
> >
> > On 3/13/19 12:50 PM, Chris Wood wrote:
> > > Indeed, I forgot to consider these other subgroups when preparing the
> > > PR. While the new cofactor check ensure that the small subgroups are
> > > avoided, it does not help against those groups that are multiples of p
> > > and (small) divisors of h. So perhaps in addition to the small subgroup
> > > check, could we also use the result of the cofactor multiplication in
> > > each computation? That is, for SPAKE, use S*h and T*h instead of S and H
> > > when computing the shared secret? Currently, -08 says this is not done:
> >
> > That would work, but using scaled x and y coefficients solves the same
> > problem, and is more consistent with X25519.  So I don't really know
> > problem what the coefficient change in -08 was trying to solve.
> >
> > (I now agree with Kenny that there was a problem specifically with
> > SPAKE2+.  But no changes to the SPAKE2 writeup should be required to
> > solve that.)
> >
> > _______________________________________________
> > Cfrg mailing list
> > Cfrg@irtf.org
> > https://www.irtf.org/mailman/listinfo/cfrg