[openpgp] Re: Encryption subkey selection

Johannes Roth <johannes.roth@mtg.de> Tue, 06 May 2025 09:29 UTC

Return-Path: <johannes.roth@mtg.de>
X-Original-To: openpgp@mail2.ietf.org
Delivered-To: openpgp@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 7362C254561E for <openpgp@mail2.ietf.org>; Tue, 6 May 2025 02:29:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.1
X-Spam-Level:
X-Spam-Status: No, score=-2.1 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=mtg.de
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v-i7GsW-Ih4j for <openpgp@mail2.ietf.org>; Tue, 6 May 2025 02:29:27 -0700 (PDT)
Received: from www.mtg.de (www.mtg.de [IPv6:2a02:b98:8:2::2]) (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id E54B42545615 for <openpgp@ietf.org>; Tue, 6 May 2025 02:29:26 -0700 (PDT)
Received: from minka.mtg.de (minka [IPv6:2a02:b98:8:1:0:0:0:9]) by www.mtg.de (8.18.1/8.18.1) with ESMTPS id 5469TMqb022372 (version=TLSv1.3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256 verify=NOT); Tue, 6 May 2025 11:29:22 +0200
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mtg.de; s=mail201801; t=1746523762; bh=PrSi6oZScHDGyCu4LeemPS00QnkA4b2wfwwIgqmQ9CM=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=N13KAWvReG/aZ8YcXl8HlRoxG28wFUbK+8RtX+PMQSI/IrirxLONAL5YrB/IBEqQu vKXf4bYXFbf8P43ApB8YBc7cFx1pSQWt9/xaYI8pSjoNr1Y1ABK04JjUpG/n8YPQ4M /wxTpIjDPCkq1AgL0LckQ5iovBFD50KDwGXu0xL/I0cGA8HMXvre8s++isd0w2ZOJ5 7nmyicKBPhmmgj9/MGMnhHQAlMEpTWU4Q6YmW5Om4l+Oj0r/7R0IOnd3NZcWmIPh1k ow62FnR0+SPSdu9ccWlONAfBsktL0Lmm48WuzuKRkkjHLux5+t4aqElTHGMn8YY8Ie dboS6Od0YwNfQ==
Received: from [199.99.99.52] (abahachi [199.99.99.52]) by minka.mtg.de (8.18.1/8.18.1) with ESMTPS id 5469TKpx032407 (version=TLSv1.3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256 verify=NOT); Tue, 6 May 2025 11:29:20 +0200
Message-ID: <56926474-5bfc-485d-a120-e21554a40e02@mtg.de>
Date: Tue, 06 May 2025 11:29:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: Daniel Huigens <d.huigens=40protonmail.com@dmarc.ietf.org>, Falko Strenzke <falko.strenzke@mtg.de>
References: <87h631mvol.fsf@thinbox> <dI4YtuyWCyCqKizRafc2sNHBFSRSuQEt-03l8CBI-bRD4SPN7701nRDLFYtu0hwve96cG3Q4kIglx6oVTIAiJbVJseQRzLrt2AoKpSLes28=@protonmail.com> <87ecxupx9w.fsf@europ.lan> <ToH9iWOoC_CgdIu1k9gaMAaNzpZ5nwHbPScoiuJr_RIQpz6Wv1Z7qY9iaKepYMwLlynVkNytyotr-FWEFRBA5saNHy7N_1dmbcMC310quFM=@protonmail.com> <878qnahdhv.fsf@fifthhorseman.net> <0d7e2367-c6fa-483b-af3b-59cdb0a98c1f@mtg.de> <Ef6BOqB4sJojhX8zVFA6lCxASrnsV1rG_bF85V4_YHy1SutHgh3BW5f2hTNppvMcUOpmjtcMCiEYVVkAxcMLDMYAiUm2v-MN6qHRvqYYS-M=@protonmail.com>
From: Johannes Roth <johannes.roth@mtg.de>
Organization: MTG AG
In-Reply-To: <Ef6BOqB4sJojhX8zVFA6lCxASrnsV1rG_bF85V4_YHy1SutHgh3BW5f2hTNppvMcUOpmjtcMCiEYVVkAxcMLDMYAiUm2v-MN6qHRvqYYS-M=@protonmail.com>
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha-512"; boundary="------------ms070304060102080505080206"
Message-ID-Hash: NHGYFHH3JU52MS4IL5TITQG2BAYGZX2Q
X-Message-ID-Hash: NHGYFHH3JU52MS4IL5TITQG2BAYGZX2Q
X-MailFrom: johannes.roth@mtg.de
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-openpgp.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: Daniel Kahn Gillmor <dkg@fifthhorseman.net>, openpgp@ietf.org
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [openpgp] Re: Encryption subkey selection
List-Id: "Ongoing discussion of OpenPGP issues." <openpgp.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/qoP4SGKzhHlOU1au5YDqAc6qKLM>
List-Archive: <https://mailarchive.ietf.org/arch/browse/openpgp>
List-Help: <mailto:openpgp-request@ietf.org?subject=help>
List-Owner: <mailto:openpgp-owner@ietf.org>
List-Post: <mailto:openpgp@ietf.org>
List-Subscribe: <mailto:openpgp-join@ietf.org>
List-Unsubscribe: <mailto:openpgp-leave@ietf.org>

Hi all,

I agree with Falko that the ordering by algorithm ID is not ideal. 
Currently, with ML-KEM only, this is not a problem. As soon as we add a 
new algorithm that also has two IDs with different security levels, the 
logic doesn't guarantee the preference of the stronger keys. However, as 
a sane default logic it might be ok and the "weaker" keys are still 
considered sufficiently strong, just with less security margin. Also, 
nothing prevents implementations to implement their own logic. However, 
this also means that we cannot assume that all implementations follow 
the proposed default logic, making it impossible for certificate holders 
to express their own ordering reliably with this approach.

Note that there might be further edge cases if two equally strong 
parameter sets are introduced for an algorithm. Then, the one assigned a 
higher ID would always be preferred which might not always be ideal. We 
have this for signatures, currently: SLH-DSA 128f and 128s offer the 
same security but different tradeoffs with respect to size and speed.

Personally I am a bit skeptical about specifying the subkey creation 
time as a primary selection criterion. It somewhat overloads the simple 
statement about the creation time. If you have a PQC-only certificate 
and realize you need an ECDH key for backwards compatibility, you would 
need to set the creation time to an earlier date than your PQC keys 
which is counter-intuitive, and also requires you to add this delta to 
your expiry time, otherwise it will expire earlier than intended. At 
this point, I would consider it more sensible to let the certificate 
holder express his order preferred order explicitly.

Bottom line: I think having such a default logic makes sense, but I also 
think it won't reliably solve the problems it addresses. In case we only 
specify PQC algorithms from now on, it would at least ensure the 
prefernce of PQC keys.

Best,
Johannes

On 06.05.2025 10:06, Daniel Huigens wrote:
> Hi Falko,
> 
> On Tuesday, May 6th, 2025 at 08:22, Falko Strenzke wrote:
>>
>> Preferring the higher algorithm ID doesn't work for a simple reason: 
>> there are different security levels for each algorithm stacked one 
>> after another as code points (2 for ML-KEM currently). This means that 
>> the suggested selection mechanism might result in the preference of 
>> strictly weaker keys.
>>
> Saying that the proposal "doesn't work" is a very strong statement but 
> what I think you mean is: it might lead to suboptimal outcomes in 
> certain cases, namely if someone has a certificate with two encryption 
> subkeys, one of which is 1. weaker and 2a. has a later creation 
> timestamp or 2b. an equal creation timestamp and a higher algorithm ID.
> 
> My question would be: why would the certificate holder want to create 
> such a certificate? Do such certificates already exist in the wild?
> If we all agree on this encryption subkey selection algorithm, we can 
> just agree to not do that, and give the stronger subkey a higher 
> creation timestamp.
> Or, for future algorithms we can tweak the algorithm, if needed.
> 
> I would also like to note that we don't achieve optimal outcomes in all 
> cases in the current implementations. For example, two out of three 
> implementations don't achieve post-quantum security for the PQC test 
> vectors with multiple subkeys, as noted in the parallel thread. With 
> this proposal, that would be fixed. So, I think it's strictly an 
> improvement over the status quo :)
> 
> Best,
> Daniel
> 
> 
> 
> _______________________________________________
> openpgp mailing list -- openpgp@ietf.org
> To unsubscribe send an email to openpgp-leave@ietf.org