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

Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Mon, 23 March 2015 20:55 UTC

Return-Path: <ilari.liusvaara@elisanet.fi>
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 3FBB81A1A98 for <tls@ietfa.amsl.com>; Mon, 23 Mar 2015 13:55:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham
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 OdbOcdy8cNXH for <tls@ietfa.amsl.com>; Mon, 23 Mar 2015 13:55:01 -0700 (PDT)
Received: from emh02.mail.saunalahti.fi (emh02.mail.saunalahti.fi [62.142.5.108]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CB4411A1A92 for <tls@ietf.org>; Mon, 23 Mar 2015 13:55:00 -0700 (PDT)
Received: from LK-Perkele-VII (a88-112-44-140.elisa-laajakaista.fi [88.112.44.140]) by emh02.mail.saunalahti.fi (Postfix) with ESMTP id 8377481801; Mon, 23 Mar 2015 22:54:57 +0200 (EET)
Date: Mon, 23 Mar 2015 22:54:57 +0200
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
To: Hugo Krawczyk <hugo@ee.technion.ac.il>
Message-ID: <20150323205457.GA23158@LK-Perkele-VII>
References: <CABcZeBNmufvfJ_2Nvw1YwvwGZ2u1=WvL45rPGJXARN1tAxOEfw@mail.gmail.com> <1427123147.19595.62.camel@redhat.com> <CADi0yUMxvN3hHJ2zx7m5hOrPdu080DjvyOGim8c3++QETcx3bA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CADi0yUMxvN3hHJ2zx7m5hOrPdu080DjvyOGim8c3++QETcx3bA@mail.gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
Sender: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/cjesf5CVcoeWNZb0rb61MdX0yTY>
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 20:55:03 -0000

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