Re: [TLS] Initial draft of DH-based key exchange

Hugo Krawczyk <hugo@ee.technion.ac.il> Mon, 23 March 2015 21:05 UTC

Return-Path: <hugokraw@gmail.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 841F81A1AE3 for <tls@ietfa.amsl.com>; Mon, 23 Mar 2015 14:05:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.277
X-Spam-Level:
X-Spam-Status: No, score=-1.277 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=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 GKSpzLkat3ol for <tls@ietfa.amsl.com>; Mon, 23 Mar 2015 14:05:54 -0700 (PDT)
Received: from mail-la0-x22f.google.com (mail-la0-x22f.google.com [IPv6:2a00:1450:4010:c03::22f]) (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 350331A1A6C for <tls@ietf.org>; Mon, 23 Mar 2015 14:05:54 -0700 (PDT)
Received: by laae1 with SMTP id e1so12364398laa.2 for <tls@ietf.org>; Mon, 23 Mar 2015 14:05:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=rwRQ7Tqe5B1XksPQWNn34Yaoom5PGyzn7ZxYt1OQW8A=; b=ft66QNNHn7jFFRycty1zHeocWR+nPqPxaAzeacvS+672e6632sOrOqZFH/nspCxsbZ B2IBzRdvNXIDWTbVbp0lT/W4TdB9KVF5mEAKKbva/Jkd8HhVkYi7NJjeDURfFNQGsxUU h/3QbR7AVPH3RtZI5HCHN7smgOxU8vFSz/M0M1/FiLl61PBV1gW5wgESCp4eeooMezG2 DVtbd5tq5wNyvLVOgpjlWLuLcL86ekujL/urNmBymNvjcA617t6sElPT1Al3x3Gp0wRU JV1HA2vebakcj0VR1WFk2nD+gh7cLd7l3b7Wqewgtw1ZOs/mPw8fxzvSEWyjjld1zTLk jWJQ==
X-Received: by 10.112.42.41 with SMTP id k9mr910292lbl.90.1427144752739; Mon, 23 Mar 2015 14:05:52 -0700 (PDT)
MIME-Version: 1.0
Sender: hugokraw@gmail.com
Received: by 10.25.78.19 with HTTP; Mon, 23 Mar 2015 14:05:22 -0700 (PDT)
In-Reply-To: <20150323205457.GA23158@LK-Perkele-VII>
References: <CABcZeBNmufvfJ_2Nvw1YwvwGZ2u1=WvL45rPGJXARN1tAxOEfw@mail.gmail.com> <1427123147.19595.62.camel@redhat.com> <CADi0yUMxvN3hHJ2zx7m5hOrPdu080DjvyOGim8c3++QETcx3bA@mail.gmail.com> <20150323205457.GA23158@LK-Perkele-VII>
From: Hugo Krawczyk <hugo@ee.technion.ac.il>
Date: Mon, 23 Mar 2015 17:05:22 -0400
X-Google-Sender-Auth: BlgoCNxrEP-t5YBix1Kr1Fct5Go
Message-ID: <CADi0yUMqYKJKJN4KrRC5dymAYqUZ+VqYTRJmCmkhzfHbb=YO3Q@mail.gmail.com>
To: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Content-Type: multipart/alternative; boundary="001a113367fc07bcb70511fb08db"
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/O6oogwmw8ITznJHdT8ANoM5zFXI>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Initial draft of DH-based key exchange
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 23 Mar 2015 21:05:57 -0000

0-RTT with (EC)IES is exactly what we are doing.
Keeping online signatures is what the WG wanted (the other option is
offline signatures or DH certificates which had opposition).
If you can come with a simplified design combining these things, I will be
happy to hear.

The KDF derivation scheme is as simple as it gets for all keys that need to
be derived and is uniform for all modes.
You could save one level of extraction if you were willing to key the prf
with your DH secrets, which I do not recommend.

Hugo


On Mon, Mar 23, 2015 at 4:54 PM, Ilari Liusvaara <
ilari.liusvaara@elisanet.fi> wrote:

> On Mon, Mar 23, 2015 at 03:22:05PM -0400, Hugo Krawczyk wrote:
> > Hi Nikos,
> >
> > These are good questions - see responses below.
> >
> > On Mon, Mar 23, 2015 at 11:05 AM, Nikos Mavrogiannopoulos <
> nmav@redhat.com>
> > wrote:
> >
> > > On Mon, 2015-03-23 at 08:36 -0500, Eric Rescorla wrote:
> > > [...]
> > > > The WG sentiment was generally favorable to exploring this avenue but
> > > > there was also airly strong WG sentiment that we didn't presently
> want
> > > > to do an offline signatures. This leaves with a model in which the
> > > > client initially learns the server's semi-static DH share through
> > > > an online-signed 1-RTT handshake but then can cache it for use with
> > > > future connections.
> > >
> > > Wasn't that discussed in the list before? My impression was that the
> > > outcome of that discussion was not to add that.
> > >
> >
> > ​The objections to the original proposal were related to the use of
> offline
> > signatures to sign a semi-static DH key. This is not an option in ekr's
> > draft. Neither the draft accommodates DH certificates. All server's
> > authentication is based on regular (online) TLS signatures except if the
> > client has cached a semi-static key from the server as needed to support
> > 0-RTT.
>
> I think that is the worst case.
>
> ECC signature generation are faster than ECDH operation. But OTOH, ECDH
> operation is much easier to implement than ECC signature. So one gets
> slowdown for no simplification.
>
> Also, two-level key schemes have certain benefits, but lack of offline
> signing makes it one-level key scheme with two keys.
>
> > > Anyway, a first question that comes to mind, is why this isn't defined
> > > as separate ciphersuites? Why does it even have to be TLS 1.3 related?
> > > Static DH parameters is an experiment that failed years ago. What has
> > > changed since then that we believe now it is going to work? You even
> > >
> >
> > ​Two important things change in TLS 1.3:​
> > - Forward secrecy (PFS) is now mandatory.
> > - The protocol accommodate a 0-RTT mode.
> >
> > These two changes can only be implemented via Diffie-Hellman transforms
> (in
> > theory, any CCA-secure public key encryption can be used but (EC)DH is
> the
> > only currently practical instantiation in this setting). In particular,
> > 0-RTT requires supporting semi-static DH keys for the server. All that
> ekr
> > draft does is to build a protocol where PFS is supported, 0-RTT is
> > supported, semi-static keys are supported, and TLS-type signatures are
> > supported in any case where the client does not have a cached semi-static
> > key of the server. The beauty of it, if I can say so, is that all these
> > modes are just subsets of a single protocol with a single crypto logic
> and
> > uniform specification (which also covers uniformly PSK and resumption).
> >
> > The alternative is to keep TLS 1.2 and add to it the semi-static case as
> a
> > patch, hence requiring essentially implementing all that is now in ekr's
> > draft (for PFS and 0-RTT) plus all the mechanics of 1.2. From the
> > cryptographic analysis point of view this would mean analyzing two
> separate
> > protocols as well as making sure these two protocols do not have any bad
> > interaction when put together.
>
> The simplest way to do 0RTT would be for server to signal parameters for
> 0RTT in extension and then client to put public keys and 0RTT data
> ((EC)IES)
> into ClientHello extension (doesn't work that well in TLS 1.2 still).
>
> Of course, that provodes absolutely no replay protection...
>
> > > dropped the static DH ciphersuites from TLS 1.3. Please make that part
> > > optional so you don't doom the whole TLS 1.3 protocol enhancements if
> > > no-one switches to static DH keys (in the document they are described
> as
> > > semi-static DH keys - but there is no definition of what that means).
> > >
> > > A second question is why HKDF? Why is it even there? Is there any issue
> > > with the current TLS PRF and we need another? Is there a valid reason
> to
> > > bloat implementations with shipping multiple KDFs? This kind of changes
> > > shouldn't be done without thought, as it is now there cannot be any
> code
> > > sharing between TLS 1.2 and 1.3 and we risk having implementers stay
> > > with TLS 1.2 for the next decade.
> > >
> >
> > ​HKDF is just a way of structuring the use of TLS PRF (HMAC-PRF) in a way
> > that supports a uniform, hierarchical key derivation scheme which is
> common
> > to all the modes of the protocol as discussed above (including PSK,
> Export,
> > resumption, etc.) and which accommodates deriving keys from possibly
> > non-uniform secrets such as DH values, passphrases, etc. In particular,
> it
> > sets no requirements or assumptions in the form of the secret/entropy
> > source from which keys are derived, hence freeing the protocol
> > instantiation from things like point representation in an elliptic curve
> > (it will work with compressed representation, uncompressed ones, etc).
> >
> > I believe these are all huge benefits at all levels: design, analysis,
> > specification, implementation, maintenance of the protocol (future
> > changes/additions). I cannot comment on code sharing though, although I
> > hope we do not ruin the future by tying ourselves too much to the past.
>
> Well, to me the key derivation in EKR draft (using HKDF) looks much more
> messy than the one in editor draft (using classic TLS PRF)
>
>
> -Ilari
>