Re: [Cfrg] Integration of OPAQUE in IKEv2

Hugo Krawczyk <hugo@ee.technion.ac.il> Thu, 12 September 2019 14:57 UTC

Return-Path: <hugokraw@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 ED095120041 for <cfrg@ietfa.amsl.com>; Thu, 12 Sep 2019 07:57:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.921
X-Spam-Level:
X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.026, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 OPtl7DIM94Fd for <cfrg@ietfa.amsl.com>; Thu, 12 Sep 2019 07:56:56 -0700 (PDT)
Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 B039D12003E for <cfrg@ietf.org>; Thu, 12 Sep 2019 07:56:56 -0700 (PDT)
Received: by mail-io1-f45.google.com with SMTP id f4so54662097ion.2 for <cfrg@ietf.org>; Thu, 12 Sep 2019 07:56:56 -0700 (PDT)
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:from:date :message-id:subject:to:cc; bh=IVdfQPVUYn2mdmo+QVQAlPk5kQQ8Neo1dgnoExfLr98=; b=X0h9wjsqF38wOBw+ipoPtI2XrEgz7/gTf4FaEMYXXBAYn7zcTCEb/zX1CJ/1MQr5vJ s/UooBtmArVyIahMoZRImPd4exKaBmwmyeBrg61XMiv7TrGrKxgEcfepDcK/gKB5KXES lkpMxQ3OioAQM2de7ohnxIgIaak2xhnXUbxecCX/sEOojJ2O6xWyHyNMueFZUjSo5u0z n5Cre4JknnsydGO4cPHiF/TEeTd07bNvZvYkKlS3G61q8lsfxUBMPXvKI7idRT5Gr9RX ExfUnia87rBhvwVMjgjAmHU4N7XQnC2nQHqzdWzxh7Yevn0JaXRBAyd6ZWlsF+MoxNpT 8y/A==
X-Gm-Message-State: APjAAAVU3nfjO94f0DDU9Spnj3bh6XVhi1fs/+IETHt9Cr1X5SOjermp RO8qAjXFC5oXngYeynQQy2WgIG/m46ENcryN9/w=
X-Google-Smtp-Source: APXvYqzFdmloTnUHV1zwz36ifRNfl7oqwlHj3Exy1mhnZF45BeTwGH0NzoIcLlimBGLceYPfWxjBxumQneDLHRq2B8M=
X-Received: by 2002:a02:3401:: with SMTP id x1mr25107698jae.23.1568300215688; Thu, 12 Sep 2019 07:56:55 -0700 (PDT)
MIME-Version: 1.0
References: <0791DF4A-098E-4753-B886-BFC2D7DA1F97@gmail.com> <CADi0yUN=+mX80ESTnttgVYk+mT3jTWZ=mcqB28T5YmdRQZ1bhw@mail.gmail.com> <011001d56937$46284660$d278d320$@gmail.com>
In-Reply-To: <011001d56937$46284660$d278d320$@gmail.com>
From: Hugo Krawczyk <hugo@ee.technion.ac.il>
Date: Thu, 12 Sep 2019 10:56:29 -0400
Message-ID: <CADi0yUNtesdT+sahDia6+X0QDP3Ac2nohcg3GUdvDjb6WFsTLA@mail.gmail.com>
To: Valery Smyslov <smyslov.ietf@gmail.com>
Cc: Yoav Nir <ynir.ietf@gmail.com>, "<cfrg@ietf.org>" <cfrg@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000041e54705925c591a"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/TNXZ8lEeE3oMN5vYLRLNeal89vo>
Subject: Re: [Cfrg] Integration of OPAQUE in IKEv2
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: Thu, 12 Sep 2019 14:57:01 -0000

Hi Valery,

Thanks for the clarifications.

If IKEv2 requires full rounds Initiator-Responder then one needs to add one
round trip to the original IKEv2 as you propose. I am ok with AUTH in the
last flow.
Finally, regarding the definition of AUTH, I now see that the signed
stream <InitiatorSignedOctets>
is defined to include the nonce and prf(SK_pi, IDi') - and similarly for
the responder, so this is indeed *exactly* how IKEv2 works. This shows the
advantage of the modular composition: you get security directly by the
(already analyzed) security of the underlying AKE protocol, in this case
IKEv2 (no need to re-analyze). In case of OPAQUE you also get security
against pre-computation attacks.

The added cost in the case of IKEv2 (due to the OPRF computation)  is one
additional round, a single exponentiation for the server  and two for the
client (with one or both of these exponentiations using a fixed base), plus
a hash into the curve for the client.  There is also the hardening on the
client side (iterated hashing, Argon2, scrypt, etc.) against offline
attacks at the server and online attacks at the client (hardening should be
mandatory for all proposals).

 Thanks again Valery.

Hugo

On Thu, Sep 12, 2019 at 2:57 AM Valery Smyslov <smyslov.ietf@gmail.com>
wrote:

> HI Hugo,
>
>
>
> Hi Yoav and Valery,
>
>
>
> thanks for your extensive analysis of the different PAKE candidates.
>
> I would like to clarify some issues regarding the way you
> envision the integration of OPAQUE in the context of IKEv2.
>
> Let me first refer to Yoav's analysis
>
> https://mailarchive.ietf.org/arch/msg/cfrg/PWhIOQKBHapZ1Rpbd7Brr_JFIg8
>
> where he says:
>
> > OPAQUE spends one round-trip on sending IDi and receiving EnvU and vU.
> > OPAQUE spends another round-trip on the OPRF protocol.
> > OPAQUE spends yet another round-trip for a KE exchange.
> > The final IKE_AUTH flow uses the generated key for the AUTH payloads.
> > Altogether 5 round-trips (or IKE_AUTH exchanges) are needed for user
> > authentication.
>
> This mimics the modular description in the OPAQUE draft that shows the
> different
> logical components. However, these components need not be run sequentially
> but
> rather in parallel, namely, piggybacking the OPRF to any existing AKE
> protocol.
> This is exemplified in the OPAQUE draft for any AKE with 3 flows as
> follows:
>
>    Generic OPAQUE with 3-message KE:
>
>    o  C to S: Uid, alpha=H'(PwdU)*g^r, KE1
>
>    o  S to C: beta=alpha^kU, vU, EnvU, KE2
>
>    o  C to S: KE3
>
> Thus, one can integrate OPAQUE with IKEv2 at the cost of a single
> additional
> message from C to S, and no change to the AUTH mechanics.
>
> Here is how it would look (I keep Yoav's notation and add the OPAQUE
> elements in
> < ... >). The only changes to regular IKEv2 are piggybacking the elements
> alpha, beta, vU, EnvU to the existing IKEv2 flows and adding the last
> client-to-server flow with the AUTH value.
>
>
>    User                              Server
>    -------------------------------------------------------------------
>    HDR, SAi1, KEi, Ni  -->
>                                 <--  HDR, SAr1, KEr, Nr,
>    HDR, SK {IDi,
>        [IDr,] SAi2,
>        TSi, TSr
>        <alpha>}     -->
>                                 <--  HDR, SK {IDr, AUTH, <beta, vU, EnvU>}
>    HDR, AUTH       -->
>
>
> Server's AUTH needs no change, except that the signature is computed with
> the server's key authenticated under EnvU, and client's AUTH in the added
> flow is computed under the user's key under EnvU.
>
> The first two flows don't change (except maybe for a HDR type indicating
> password authentication). The value IDi is used to transfer user's account
> information (whose privacy is protected against passive adversaries by
> virtue of
> the DH exchange (KEi, KEr)).
>
> As you can see, my depiction above is quite similar to the way Valery
> Smyslov
> https://datatracker.ietf.org/doc/html/draft-smyslov-ikev2-pake
> integrates OPAQUE with IKEv2, with two notable differences.
> Valery's version (top of page 10 in the draft) takes three round trips
> (instead
> of 2.5) as he delays the server's AUTH to an additional sixth flow.
>
>
>
>           I did this for the purpose. IKEv2 is a strict request-response
> protocol,
>
>           so that initiator sends a request message and responder
>
>           sends a response. It is the initiator who is responsible for
>
>           any retransmission in case request or response get lost.
>
>          This is a core principle of IKEv2 and for this reason non-integer
>
>          RTTs are non-applicable for IKEv2. In your example the proper
> sequence
>
>          would be:
>
>
>
>    User                              Server
>    -------------------------------------------------------------------
>    HDR, SAi1, KEi, Ni  -->
>                                 <--  HDR, SAr1, KEr, Nr,
>    HDR, SK {IDi,
>        [IDr,] SAi2,
>        TSi, TSr
>        <alpha>}     -->
>                                 <--  HDR, SK {IDr, AUTH, <beta, vU, EnvU>}
>    HDR, AUTH       -->
>
>                                 <--  HDR, SK{}
>
>
>
>       which, in my opinion, is no better than my proposal,
>
>        because it also changes the order AUTH payloads are
>
>        computed by initiator and responder (I prefer the
>
>        initiator authenticates itself first to decrease possible DoS
> attacks surface).
>
>
>
> In contrast, I include this information in the fourth flow.
> More significantly, Valery re-defines the AUTH values as
>                AUTHi = sig(PrivU, <InitiatorSignedOctets>)
>                AUTHr = sig(PrivS, <ResponderSignedOctets>)
> This is not necessary. One can keep IKEv2's AUTH unchanged (as I said,
> only the
> public keys change from certificate-based to EnvU-based). Actually,
> defining
> AUTH i/r as above would not be secure (it departs from the necessary logic
> of
> SIGMA-R underlying IKEv2).
>
>
>
>           Here I’m confused. Actually, the above AUTH payload calculation
>
>           is exactly as it is done in IKEv2 (or in SIGMA) with the
> assumption
>
>           that once the OPAQUE is complete each peer can use its private
>
>           key Priv[U|S] for signing. I believed I didn’t change AUTH
> calculation
>
>           in case of OPAQUE at all. From RFC7296, Section 2.15:
>
>
>
> 2.15.  Authentication of the IKE SA
>
>
>
>    When not using extensible authentication (see Section 2.16), the
>
>    peers are authenticated by having each sign (or MAC using a padded
>
>    shared secret as the key, as described later in this section) a block
>
>    of data.
>
>
>
>      Later in this section this block of data is depicted as
> InitiatorSignedOctets
>
>           for initiator and as ResponderSignedOctets for responder.
>
>
>
>           So, I failed to understand where I changed the way AUTH payload
>
>           is calculated for the OPAQUE. Am I missing something?
>
>
>
>           Thank you,
>
>           Valery.
>
>
>
> Finally, responding to one of the points of Yoav, the password registration
> procedure only takes 3 flows (C to S, S to C, C to S).
>
> The common point to the above comments is that integrating OPAQUE into an
> existing protocol should be quite painless. You just need to piggyback the
> two
> OPRF messages and EnvU to the existing key exchange flows. Assuming
> extensibility of the protocol to accommodate the above elements, the cost
> would
> be at most one additional flow for user's explicit authentication.
> Computation-wise it's just one exponentiation for the server and two for
> the
> client (with one or both of these exponentiations using a fixed base),
> plus a
> hash into the curve by the client.
>
> Let me know if the above makes sense to you and whether I missed something
> significant about the way IKEv2 works.
>
> Thanks again!
>
> Hugo
>
>
>
>
>
>