[openpgp] Re: Deterministic generation of (symmetric) public key params from private key params

Daniel Huigens <d.huigens@protonmail.com> Wed, 13 November 2024 15:27 UTC

Return-Path: <d.huigens@protonmail.com>
X-Original-To: openpgp@ietfa.amsl.com
Delivered-To: openpgp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2463FC151062 for <openpgp@ietfa.amsl.com>; Wed, 13 Nov 2024 07:27:27 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.102
X-Spam-Level:
X-Spam-Status: No, score=-2.102 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=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
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=protonmail.com
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 rYCVXV0J-tgQ for <openpgp@ietfa.amsl.com>; Wed, 13 Nov 2024 07:27:23 -0800 (PST)
Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 13BA0C14F747 for <openpgp@ietf.org>; Wed, 13 Nov 2024 07:27:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1731511641; x=1731770841; bh=BrLArR6KTnKAvMkLfsEY5zQI6Nox9bxg+zH/n1rjwjs=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=OYtCi2GgL+OWuj7khecx6aGxhiCa8opafJ2CA3qZyLs0ZyqZJk4uVMeXjmuGiBD3j LR9NBCJ0qej0KtbLTT5vEkJOfJP4yGranrasL1yrJStSNnFXmBITALL0sDk+cXEJvX eVHqOcTDQbH71yaG0Ba3CC95pOGHgUWt4N2lPueH02kNXjPrXQspfuKGaKJUPehlok +Klg5LZTv7wua8Et4HM8RX7jC7FBb+07utXebiTbPxfOIAzFMVVCSwRbZPTZxuOEm3 I1rkJzM3LzKMsykG/NAUNihBp+71xYw/dRvMk93tGYCk2LOrzsi9mC3I3QP2Fi+H4U BExTx9Dev22ag==
Date: Wed, 13 Nov 2024 15:27:16 +0000
To: Justus Winter <justus@sequoia-pgp.org>
From: Daniel Huigens <d.huigens@protonmail.com>
Message-ID: <prYwCJCeUbCUx9PF-bWdQf-DpImAj18NQ9VhjOH0NpT-6WFmO_4JHrmI-2x0laDmEKjVVEif6GPZJa4rhz64k8-2-aZW6Og03YG6RLeGtfA=@protonmail.com>
In-Reply-To: <87a5e3xmba.fsf@europ.lan>
References: <FxKXcgs81L4JQJjqV8sB_941ghtKVj5cjVYx6povy95enL27NdtRWhG5cLgElc9jJXQRqFqbTroNYlSL1agjgDVfRTmKJtKVwJkC0U1PmS8=@protonmail.com> <87a5e3xmba.fsf@europ.lan>
Feedback-ID: 2934448:user:proton
X-Pm-Message-ID: 4dc1f6ff158e86272baf9911644125fb3133b8b3
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Message-ID-Hash: FD5GXWRJIILURAW3UI4YDEHHJE52WFKS
X-Message-ID-Hash: FD5GXWRJIILURAW3UI4YDEHHJE52WFKS
X-MailFrom: d.huigens@protonmail.com
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: IETF OpenPGP WG <openpgp@ietf.org>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [openpgp] Re: Deterministic generation of (symmetric) public key params from private key params
List-Id: "Ongoing discussion of OpenPGP issues." <openpgp.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/S7nkdUdxwoRvk2Q519Do5OcYNFU>
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 Justus :)

On Wednesday, November 13th, 2024 at 15:03, Justus Winter wrote:
> I don't understand the motivation for the hash seed in the first place.
> Why not derive a mock public key from the secret key, i.e. include
> SHA2-256(persistent symmetric key material) in the algorithm-specific
> bits of the public key packet?

I'm not 100% sure this is safe in all scenarios. For an AES-256 key it
probably is, but for an AES-128 key, due to the birthday paradox, after
"only" 2^64 keys there's a ~50% chance that two people will share a key.

If the encrypted private keys are stored on a server, like Proton does,
then the server can find out which two users share a private key by
looking at the public key material; and ask one user to decrypt a
message of the other user, for example. That seems bad.

We could say that persistent symmetric keys may only be used with >=256
bit keys, but having a separate hash seed just seemed simpler and easier
to reason about.

Best,
Daniel