Re: [Cfrg] Review of draft-irtf-cfrg-hpke-02

Ilari Liusvaara <ilariliusvaara@welho.com> Wed, 18 December 2019 15:50 UTC

Return-Path: <ilariliusvaara@welho.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 079EF120834 for <cfrg@ietfa.amsl.com>; Wed, 18 Dec 2019 07:50:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.598
X-Spam-Level:
X-Spam-Status: No, score=-2.598 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=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 oozOjNOGaU2X for <cfrg@ietfa.amsl.com>; Wed, 18 Dec 2019 07:50:09 -0800 (PST)
Received: from welho-filter1.welho.com (welho-filter1.welho.com [83.102.41.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8AD6F12025D for <cfrg@irtf.org>; Wed, 18 Dec 2019 07:50:09 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by welho-filter1.welho.com (Postfix) with ESMTP id 95DC615A54; Wed, 18 Dec 2019 17:50:06 +0200 (EET)
X-Virus-Scanned: Debian amavisd-new at pp.htv.fi
Received: from welho-smtp3.welho.com ([IPv6:::ffff:83.102.41.86]) by localhost (welho-filter1.welho.com [::ffff:83.102.41.23]) (amavisd-new, port 10024) with ESMTP id zvQIqmnsUNGr; Wed, 18 Dec 2019 17:50:06 +0200 (EET)
Received: from LK-Perkele-VII (87-100-246-37.bb.dnainternet.fi [87.100.246.37]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by welho-smtp3.welho.com (Postfix) with ESMTPSA id C3BE82320; Wed, 18 Dec 2019 17:50:03 +0200 (EET)
Date: Wed, 18 Dec 2019 17:50:03 +0200
From: Ilari Liusvaara <ilariliusvaara@welho.com>
To: Stephen Farrell <stephen.farrell@cs.tcd.ie>
Cc: "cfrg@irtf.org" <cfrg@irtf.org>
Message-ID: <20191218155003.GA2202306@LK-Perkele-VII>
References: <F8BB57F1-4490-4FE4-B935-EF1D3C028D81@ericsson.com> <5689d764-d6b2-ddcb-6214-89b998f56f8e@cs.tcd.ie>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <5689d764-d6b2-ddcb-6214-89b998f56f8e@cs.tcd.ie>
User-Agent: Mutt/1.12.2 (2019-09-21)
Sender: ilariliusvaara@welho.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/S-MwEgqcB2I6SdDDDZnUOA8lHOE>
Subject: Re: [Cfrg] Review of draft-irtf-cfrg-hpke-02
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, 18 Dec 2019 15:50:12 -0000

On Wed, Dec 18, 2019 at 01:39:56PM +0000, Stephen Farrell wrote:
> 
> On 18/12/2019 13:24, John Mattsson wrote:
> 
> Since I didn't get a substantive response on the list,
> I'll repeat:
> 
> "Urgh. Why do we always need to define every possible
> option even though there's no real demand? There are
> already far too many combinations of modes and suites
> in hpke."
> 
> Having more or less finished my implementation now, I
> feel more strongly that additional combinatoric mess
> is a bad plan. Removing options/simplifying would be
> far better.

I do not see combinatoric mess. In fact, trying to "simplify" by
eliminating combinations could very well _increase_ complexity due
to some actual combinatorial mess. 

What can not be done is taking various axes, multiplying the
number of points and taking the resulting product as some kind of
metric of "complexity". In many cases, the sum is better metric than
the product.

Remember the SSL 3.0/TLS 1.0-1.2 ciphersuite mess? That was result
of trying to enumerate combinations. If you think it looks bad, it
is even worse to implement... Even restricted only to recommended
ones.

That said, I would drop NIST P-521 (as seems pretty much everybody
is using NIST P-384 instead).

Then SHA-512 is on-the-fence: SHA-384 is likely more than strong
enough, but SHA-384 is not strength-matched with Curve448 (assume
P-521 gets dropped), while SHA-512 is. And having SHA-256, SHA-384
and SHA-512 is very little additional complexity on top of SHA-256
and SHA-384.

If one wanted combined curve/hash pairs, I would have:

NIST P-256 with SHA-256
NIST P-384 with SHA-384
X25519 with SHA-256
X448 with SHA-512

However, this may be bad idea from complexity standpoint (it
does not reduce complexity very much if at all).

Combining groups with ciphers is definitely a bad idea from
complexity standpoint.

> We (CFRG) could punt on this by using existing IETF
> IANA registries instead of creating new ones. There is
> an almost fine match between what we need and some
> existing registries (if one squints just a little;-)
> that'd remove all this wrangling from our plate and
> that could result in the hpke RFC having only one MUST
> implement kem, kdf and aead. Additional options could
> then be haggled over in the IETF each time someone
> claims a need before subsequently being ignored by
> almost all implementers and an even higher proportion
> of deployments;-)

What registeries?

For groups there is the TLS groups, which actually has only four
recommended entries (P256/384 and X25519/448). Unfortunately it
has variety of less-than-cute stuff (not all of that banned in TLS
1.3) marked not recommended. Bonus points for having 3 entries that
are duplicates except one is banned in TLS 1.3 and one is not.

Then for ciphers, there is TLS ciphersuite registry for TLS 1.3
ciphers. That one combines hashes, sometimes in bit cryptographically
"interesting" ways. It also recommends AES-128-CCM, which is not great
(as it is associated with IoT stuff), plus has already got some less-
than-cute stuff (including NULL ciphers and 64-bit tags) marked not
recommended (with more less-than-cute stuff pending).

And both of these registeries are expert review, so they tend
to accumulate variety of stuff.


And future problem point is if someone lobs in some post-quantum key
exchange stuff. Which will work somewhere between poorly and not at
all. And post NISTPQC, that can very well have Recommended set.



-Ilari