Re: [CFRG] How to construct a hybrid signature combiner?

Ilari Liusvaara <ilariliusvaara@welho.com> Mon, 25 March 2024 13:42 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 93563C14CF15 for <cfrg@ietfa.amsl.com>; Mon, 25 Mar 2024 06:42:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.906
X-Spam-Level:
X-Spam-Status: No, score=-5.906 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, GB_AFFORDABLE=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id srpv_ug6-oyh for <cfrg@ietfa.amsl.com>; Mon, 25 Mar 2024 06:42:07 -0700 (PDT)
Received: from welho-filter1.welho.com (welho-filter1b.welho.com [83.102.41.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2FE36C14CF1B for <cfrg@irtf.org>; Mon, 25 Mar 2024 06:42:04 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by welho-filter1.welho.com (Postfix) with ESMTP id 8465120D97 for <cfrg@irtf.org>; Mon, 25 Mar 2024 15:42:02 +0200 (EET)
X-Virus-Scanned: Debian amavisd-new at pp.htv.fi
Received: from welho-smtp1.welho.com ([IPv6:::ffff:83.102.41.84]) by localhost (welho-filter1.welho.com [::ffff:83.102.41.23]) (amavisd-new, port 10024) with ESMTP id y-2DfjarKC2J for <cfrg@irtf.org>; Mon, 25 Mar 2024 15:42:02 +0200 (EET)
Received: from LK-Perkele-VII2 (78-27-96-203.bb.dnainternet.fi [78.27.96.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by welho-smtp1.welho.com (Postfix) with ESMTPSA id 192932DD for <cfrg@irtf.org>; Mon, 25 Mar 2024 15:42:01 +0200 (EET)
Date: Mon, 25 Mar 2024 15:42:00 +0200
From: Ilari Liusvaara <ilariliusvaara@welho.com>
To: cfrg@irtf.org
Message-ID: <ZgF_KMBHX-q5Ogyk@LK-Perkele-VII2.locald>
References: <87o7b6szhh.fsf@kaka.sjd.se> <20240325092711.964864.qmail@cr.yp.to>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
In-Reply-To: <20240325092711.964864.qmail@cr.yp.to>
Sender: ilariliusvaara@welho.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/KQ6NJKjBmEDSMegZCNzJUSlBGks>
Subject: Re: [CFRG] How to construct a hybrid signature combiner?
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <https://mailman.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://mailman.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Mar 2024 13:42:12 -0000

On Mon, Mar 25, 2024 at 09:27:11AM -0000, D. J. Bernstein wrote:
> Simon Josefsson writes:
> > Can we give some examples of bad hybrid signature schemes, to better
> > understand the failure modes of signature combiners?
> 
> There have been some papers (e.g., https://eprint.iacr.org/2020/1525)
> pointing out attacks against protocols for which it's reasonable to
> think that extra hashing in signature schemes would stop the attacks.

I think it is completely unreasonable for protocol to expect extra
hashing without explicitly requiring it.

 
> The extra hashing can also be carried out by protocols, so signature
> schemes can blame protocols for not being based purely on standard
> properties such as EUF-CMA, while protocols can blame signature schemes
> for not doing some cheap hashing to provide additional properties. The
> finger-pointing lets both sides avoid taking any action. It's rare for
> there to be any engineering analysis of how the ecosystem as a whole
> should avoid the attacks.

I blame the protocols.

Protocols need to identify requirements for underlying primitives and
then only use primitives that meet (or are at least thought to meet)
those requirements.

Ed25519 is a lot nicer behaved than most signatures, yet I have seen it
fail due to protocol assuming properties it does not have.

And I have seen nasty issues from protocol not explicitly stating a
security requirement it has, and then somebody adding security-breaking
algorithm.


> I think that combiners are a good place to put the hashing. We want
> combiners anyway to be sure that adding post-quantum systems isn't
> losing security. The basic reasons for having multiple signature systems
> and multiple protocols don't apply to combiners, so we should expect
> fewer combiners than signature systems and protocols, meaning less
> review work for the hashing.

How does the combiner guard against downgrade? There is no generic
method of doing so, and the effects are protocol-dependent, meaning
protocol-dependent analysis (which one would rather avoid).


> > What properties should a good generic hybrid signature combiner have?
> > Can we describe one example?
> 
> Here are some design goals and a specific combiner proposal.
> 
> As a starting point, to make it less likely for people to skip signature
> verification, it's good to have APIs producing signed messages rather
> than signatures. A hybrid of two signature systems then internally has
> 
>    (1) message -> first signature system -> signed message,
>    (2) signed message -> second signature system -> double-signed message.
> 
> This also forces the attacker to break the second signature system
> before being able to feed forgeries to the first signature system.

Most protocols (even more true if weighted by usage) are fundamentally
designed for appendix signatures, so signed messages are useless for
those protocols.

The end result of only having message signatures would be hybrid
signatures not getting deployed at all, or protocol designers coming
up with their own ways, completely incompatible and with all sorts of
exciting problems. Which would overload crypto library maintainers,
which is Extremely Bad.

ML-DSA might be "too damn big", but at least there is no BS.


>    * Most proposals for extra hashing in combiners are clearly
>      affordable because the CPU time for hashing is roughly 1% of the
>      cost of communicating the data being hashed. This proposal is
>      different, since it's incurring extra network traffic.

Not true with hot transreceiver.


>    * On the other hand, none of the claims that I've seen of
>      unaffordability of post-quantum signatures are based on such small
>      size differences. If there are real examples of 32 extra bytes
>      being unaffordable on top of post-quantum signatures, then why are
>      anti-hybrid arguments resorting to unquantified "less efficient"
>      statements? (See https://blog.cr.yp.to/20240102-hybrid.html.)

While it is less bad with signatures, with encryption, using hybrids
with hot transreceiver is >150% overhead.

The main arguments seem to be complexity and interoperability. Yes,
it is also less efficient, the question is how much and is it worth
the performance impact.

Hybrid signatures are much more complex than hybrid key exchange/
encryption. And with much less benefit.


>    * In the context of web pages (normally >2MB spread across <=10
>      connections, with maybe 6 signatures per connection), code signing,
>      etc., it's not plausible that an extra 32 bytes per signature is an
>      issue.

There are size cutoffs, and crossing those is absolutely a major
problem. However, the PQ signatures alone are likely to bust those
limits (the "too damn big" above).

E.g., QUIC handshake server reply exceeding ~7,000 bytes causes
performance to tank. And about 1/6th of that is already used up by
PQC key exchange. TLS has similar limit (I think it is somewhere in
14,000 byte ballpark).


>    * The rationale for the recommendation is a specific protocol that's
>      broken if an attacker, without seeing m, can convert a signature on
>      m into a signature on m under another public key. Saying that a
>      signature system should provide "non-resignability" is inherently
>      incompatible with a traditional signed-message ("message recovery")
>      API, which, as noted above, is less error-prone than a
>      detached-signature API.

And as noted above, signed-message API is mostly useless.


> One more recommendation is to include the signature-system name and
> application name as extra hash inputs (along with any context specified
> by the application), in a way that can be uniquely parsed across
> applications, so that signatures can't be moved across protocols.

That has been tried. Turned out to be a major mistake.




-Ilari