[lamps] Re: [EXTERNAL] Re: Seed as private key for ML-DSA and ML-KEM
Carl Wallace <carl@redhoundsoftware.com> Fri, 23 August 2024 14:08 UTC
Return-Path: <carl@redhoundsoftware.com>
X-Original-To: spasm@ietfa.amsl.com
Delivered-To: spasm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4F37FC169423 for <spasm@ietfa.amsl.com>; Fri, 23 Aug 2024 07:08:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.104
X-Spam-Level:
X-Spam-Status: No, score=-2.104 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, HTML_FONT_LOW_CONTRAST=0.001, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, 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 (1024-bit key) header.d=redhoundsoftware.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 JDVeZp0ZwEZS for <spasm@ietfa.amsl.com>; Fri, 23 Aug 2024 07:08:16 -0700 (PDT)
Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2A263C180B7F for <spasm@ietf.org>; Fri, 23 Aug 2024 07:08:15 -0700 (PDT)
Received: by mail-qv1-xf2d.google.com with SMTP id 6a1803df08f44-6bf8b41b34dso9918826d6.0 for <spasm@ietf.org>; Fri, 23 Aug 2024 07:08:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhoundsoftware.com; s=google; t=1724422095; x=1725026895; darn=ietf.org; h=mime-version:in-reply-to:references:thread-topic:message-id:cc:to :from:subject:date:user-agent:from:to:cc:subject:date:message-id :reply-to; bh=gy27CmW34qNNsXhtzl/UNAKZo9CVc6hdCsImE+eExU4=; b=oMzIkhbcRnUO25UsubOl/ZskQBt3VpF65/Oucjr7/8cjQgGKi22ZARFu4AX8l1dORy GWyBuP6egRvtfVKCYNWCoEOSdVqOJCT9vJOga1n2wohcuJSkBpBvCQifA//PoJf4+fHp RD3McxolTFDan+ErE6bmnlyXZ5v24hzOG7zUg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724422095; x=1725026895; h=mime-version:in-reply-to:references:thread-topic:message-id:cc:to :from:subject:date:user-agent:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=gy27CmW34qNNsXhtzl/UNAKZo9CVc6hdCsImE+eExU4=; b=dABRSVmyI9oORmLWEhJleznAGI5RaYDF7Ru6AgaResgJsTKmB0FplcSwSxsB4v/os5 DqWRYLqczHcXst/jDTKd4RPVNcbyA18mb780ushB8LcWSDn4skOQOa6TUyNgIceoXTig VI3DCLcOEom9uTDhLs+RNKns4+sRC/RjuNx6HFG1aWEmHMJSc1CF6gqgJ2MaoHX8SlJI RVAOgJX01UqIuiIAf79ooXEiC2peJdVBYChxEuJHfzSAuHtZ5FQt6r443ev7IGBeCH+s ne89mEOYNZ+boA9IrFVXOXmIMmRL3kK4ucf2i9yxUUCansO3Nb+iFIgGtZAOtTps/n/Y wONA==
X-Forwarded-Encrypted: i=1; AJvYcCXQG+qyWNI1b2V7KT+FwMncRtVRA4UJr+dxN+/aVzytp/T/V2xUZGBxr3vzZKcwT4UOfsvTbQ==@ietf.org
X-Gm-Message-State: AOJu0Yy4qTn+Sfub4ZQjEi2wunMJZqeaeo03Kq0I1H8MQ0vvabJAGCV6 e1HqNilUjESfhN+Iy5KKNfQtrobyXPvkJzhXeKvVWjwTCik3/fR2NIqoHSqg+y0=
X-Google-Smtp-Source: AGHT+IE83QV0jSF9qJfE+vQ3cDOQc3RhMKwcrMfrVxuBQyTVRb+9kOpoS8bZHyDuqXjboQYk2eCjLw==
X-Received: by 2002:a05:6214:5411:b0:6c1:6c74:9f7d with SMTP id 6a1803df08f44-6c16dc7c4d9mr30063726d6.32.1724422094335; Fri, 23 Aug 2024 07:08:14 -0700 (PDT)
Received: from [192.168.4.77] (pool-96-255-232-167.washdc.fios.verizon.net. [96.255.232.167]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c162d4d03bsm19030366d6.51.2024.08.23.07.08.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Aug 2024 07:08:13 -0700 (PDT)
User-Agent: Microsoft-MacOutlook/16.88.24081116
Date: Fri, 23 Aug 2024 10:08:13 -0400
From: Carl Wallace <carl@redhoundsoftware.com>
To: Mike Ounsworth <Mike.Ounsworth=40entrust.com@dmarc.ietf.org>, Phillip Hallam-Baker <phill@hallambaker.com>
Message-ID: <2C4F38B0-9F04-4677-A982-D74E6FCD1B9F@redhoundsoftware.com>
Thread-Topic: [lamps] Re: [EXTERNAL] Re: Seed as private key for ML-DSA and ML-KEM
References: <CAMjbhoUOLfcRHT12ubSsPMEnDGT=UJUCvy34VX+qJYmyoFbscg@mail.gmail.com> <CAF8qwaCb8BJLqZQ__9+QsQ1+dWw426BwS4J+vQkUwfjWhdevnA@mail.gmail.com> <CH0PR11MB573952F98971721CF82D30B59F8F2@CH0PR11MB5739.namprd11.prod.outlook.com> <CAMm+LwjKs7X3cRCzUeaAjHJRThkWh_W3DxCFyE7SOwtYYJGLyA@mail.gmail.com> <CH0PR11MB5739C68B1041F8201434B1D89F882@CH0PR11MB5739.namprd11.prod.outlook.com>
In-Reply-To: <CH0PR11MB5739C68B1041F8201434B1D89F882@CH0PR11MB5739.namprd11.prod.outlook.com>
Mime-version: 1.0
Content-type: multipart/alternative; boundary="B_3807252493_3540357352"
Message-ID-Hash: ABYVKEVNYGWIKJVOBSRZXDRDPKGRPBT3
X-Message-ID-Hash: ABYVKEVNYGWIKJVOBSRZXDRDPKGRPBT3
X-MailFrom: carl@redhoundsoftware.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-spasm.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: David Benjamin <davidben@chromium.org>, Bas Westerbaan <bas@cloudflare.com>, LAMPS <spasm@ietf.org>
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [lamps] Re: [EXTERNAL] Re: Seed as private key for ML-DSA and ML-KEM
List-Id: This is the mail list for the LAMPS Working Group <spasm.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/T4yrrDkpbGvgBbx7Se-BRBLfXUg>
List-Archive: <https://mailarchive.ietf.org/arch/browse/spasm>
List-Help: <mailto:spasm-request@ietf.org?subject=help>
List-Owner: <mailto:spasm-owner@ietf.org>
List-Post: <mailto:spasm@ietf.org>
List-Subscribe: <mailto:spasm-join@ietf.org>
List-Unsubscribe: <mailto:spasm-leave@ietf.org>
Why is only standardizing P12’s with the seed a barrier to migrating keys off old devices when the internal representation could be the SeedAndFull structure you defined? The key would be imported as seed, expanded, and stored using SeedAndFull. When migrated out, it could be shared as seed only. When imported into a new device, that device may store as seed, SeedAndFull, or some other structure. This would leave the following (with the size syntax fixed and changed to align with concatenating d and z, each of which are 32 bytes).
ML-*-PrivateKey ::= OCTET STRING (SIZE (64))
SeedAndFull ::= SEQUENCE {
seed OCTET STRING (SIZE (64)),
full OCTET STRING
}
From: Mike Ounsworth <Mike.Ounsworth=40entrust.com@dmarc.ietf.org>
Date: Friday, August 23, 2024 at 9:35 AM
To: Phillip Hallam-Baker <phill@hallambaker.com>
Cc: David Benjamin <davidben@chromium.org>, Bas Westerbaan <bas@cloudflare.com>, LAMPS <spasm@ietf.org>
Subject: [lamps] Re: [EXTERNAL] Re: Seed as private key for ML-DSA and ML-KEM
Sure, but also sometimes keys have a 30 year service lifetime, and you may need to replace the hardware (ie migrate the private keys) at some point in that interim, with the right level of admin access, you can migrate keys.
The point I’m making is that if we only standardize P12’s with the seed, then that’ll inevitably end up being one more barrier to migrating keys off old devices, in this case, when the device stored the expanded key and does not have the seed available anymore.
---
Mike Ounsworth
From: Phillip Hallam-Baker <phill@hallambaker.com>
Sent: Thursday, August 22, 2024 5:32 PM
To: Mike Ounsworth <Mike.Ounsworth@entrust.com>
Cc: David Benjamin <davidben@chromium.org>; Bas Westerbaan <bas@cloudflare.com>; LAMPS <spasm@ietf.org>
Subject: Re: [lamps] Re: [EXTERNAL] Re: Seed as private key for ML-DSA and ML-KEM
Isn't the point of being an HSM to resist that type of reverse engineering in a 'don't even try that fuming nitric acid with me' sort of fashion? On Thu, Aug 22, 2024 at 4: 23 PM Mike Ounsworth <Mike. Ounsworth=40entrust. com@ dmarc. ietf. org>
Isn't the point of being an HSM to resist that type of reverse engineering in a 'don't even try that fuming nitric acid with me' sort of fashion?
On Thu, Aug 22, 2024 at 4:23 PM Mike Ounsworth <Mike.Ounsworth=40entrust.com@dmarc.ietf.org> wrote:
Observation: you can trivially go from seed -> full key, but not full key --> seed. – at least I’m not seeing anything in FIPS 203 Algorithm 13 that the seed `d` is included in the decryption key `dk_pke`.
As the guy whose company gets called in when people have broken their on-prem PKIs, if we only allow seeds in P12’s, then I foresee problems where an HSM company goes out of business and we need to get keys out of that hardware, and they chose to only store the expanded private key and so can’t give us the seed even if we ask nicely: now we can’t use standard private key transports and will have to kludge something. The point of a standard is to be standard – to say that you’re allowed to store the key expanded internally, but then you’ll be up a creek without a paddle if you want to export it, feels wrong.
“2. Allow both seed and the expanded private key” ends up looking something like this:
This would certainly not be the most complicated thing in RFC 5912.
ML-*-PrivateKey ::= CHOICE {
seed [0] SIZE 32 OCTET STRING,
full [1] OCTET STRING,
seedAndFull [2] SeedAndFull
}
SeedAndFull ::= SEQUENCE {
seed SIZE 32 OCTET STRING,
full OCTET STRING
}
---
Mike Ounsworth
From: David Benjamin <davidben@chromium.org>
Sent: Wednesday, August 21, 2024 1:04 PM
To: Bas Westerbaan <bas=40cloudflare.com@dmarc.ietf.org>
Cc: LAMPS <spasm@ietf.org>
Subject: [EXTERNAL] [lamps] Re: Seed as private key for ML-DSA and ML-KEM
I'm also sold on option 4. On Wed, Aug 21, 2024, 11: 50 Bas Westerbaan <bas=40cloudflare. com@ dmarc. ietf. org> wrote: Hi all, NIST allows two formats in which private keys are stored ML-DSA and ML-KEM. 1. Seed. 32 bytes for ML-DSA; 64
I'm also sold on option 4.
On Wed, Aug 21, 2024, 11:50 Bas Westerbaan <bas=40cloudflare.com@dmarc.ietf.org> wrote:
Hi all,
NIST allows two formats in which private keys are stored ML-DSA and ML-KEM.
1. Seed. 32 bytes for ML-DSA; 64 bytes for ML-KEM.
2. Expanded private key. Multiple kilobytes depending on instance.
An expanded private key is obtained from the seed by calling the KeyGen_internal function.
In contrast to RSA, key generation for these algorithms is very fast. In fact, if you use spinning disks, then using a seed is probably faster than the expanded private key.
Another advantage is that we do not need to worry about private key validation. NIST specified a few checks to perform, but there are more we could do (eg. whether the decoded coefficients of \hat{s} are bounded.)
Of course a big advantage is storage space: the seeds are much smaller.
Now, how do we want to proceed? I see a few options.
1. Ignore the seed as private key.
2. Allow both seed and the expanded private key.
3. Assign separate algorithm for seed-as-private-key.
4. Switch to seed as private key only.
I prefer 4, and would otherwise go for 1.
The downside of 2 is that it adds complexity without the gain of simplifying verification. If one only cares about size savings, then one can use seed-as-private-key without needing a portable format for it.
So I'd prefer 4 and 1 second.
Best,
Bas
_______________________________________________
Spasm mailing list -- spasm@ietf.org
To unsubscribe send an email to spasm-leave@ietf.org
_______________________________________________
Spasm mailing list -- spasm@ietf.org
To unsubscribe send an email to spasm-leave@ietf.org
_______________________________________________ Spasm mailing list -- spasm@ietf.org To unsubscribe send an email to spasm-leave@ietf.org
- [lamps] Seed as private key for ML-DSA and ML-KEM Bas Westerbaan
- [lamps] Re: Seed as private key for ML-DSA and ML… Russ Housley
- [lamps] Re: [EXT] Re: Seed as private key for ML-… Blumenthal, Uri - 0553 - MITLL
- [lamps] Re: [EXT] Re: Seed as private key for ML-… Sophie Schmieg
- [lamps] Re: Seed as private key for ML-DSA and ML… Deirdre Connolly
- [lamps] Re: Seed as private key for ML-DSA and ML… Phillip Hallam-Baker
- [lamps] Re: Seed as private key for ML-DSA and ML… David Benjamin
- [lamps] Re: Seed as private key for ML-DSA and ML… Phillip Hallam-Baker
- [lamps] Re: Seed as private key for ML-DSA and ML… Phillip Hallam-Baker
- [lamps] Re: Seed as private key for ML-DSA and ML… Sophie Schmieg
- [lamps] Re: Seed as private key for ML-DSA and ML… Sophie Schmieg
- [lamps] Re: Seed as private key for ML-DSA and ML… David Benjamin
- [lamps] Re: Seed as private key for ML-DSA and ML… David Benjamin
- [lamps] Re: Seed as private key for ML-DSA and ML… Phillip Hallam-Baker
- [lamps] Re: [EXTERNAL] Re: Seed as private key fo… Mike Ounsworth
- [lamps] Re: [EXT] Re: [EXTERNAL] Re: Seed as priv… Mike Ounsworth
- [lamps] Re: Seed as private key for ML-DSA and ML… Alicja Kario
- [lamps] Re: [EXTERNAL] Re: Seed as private key fo… Bas Westerbaan
- [lamps] Re: [EXT] Re: [EXTERNAL] Re: Seed as priv… David Benjamin
- [lamps] Re: [EXTERNAL] Re: Seed as private key fo… Phillip Hallam-Baker
- [lamps] Re: [EXTERNAL] Re: Seed as private key fo… Mike Ounsworth
- [lamps] Re: [EXTERNAL] Re: Seed as private key fo… Carl Wallace
- [lamps] Re: Seed as private key for ML-DSA and ML… Phillip Hallam-Baker
- [lamps] Re: [EXTERNAL] Re: Seed as private key fo… Phillip Hallam-Baker
- [lamps] Re: [EXT] Re: [EXTERNAL] Re: Seed as priv… Blumenthal, Uri - 0553 - MITLL
- [lamps] Re: [EXT] Re: [EXTERNAL] Re: Seed as priv… Bas Westerbaan
- [lamps] Re: Seed as private key for ML-DSA and ML… Russ Housley
- [lamps] Re: Seed as private key for ML-DSA and ML… Sophie Schmieg
- [lamps] Re: Seed as private key for ML-DSA and ML… Scott Fluhrer (sfluhrer)
- [lamps] Re: Seed as private key for ML-DSA and ML… Scott Fluhrer (sfluhrer)
- [lamps] Re: Seed as private key for ML-DSA and ML… Scott Fluhrer (sfluhrer)
- [lamps] Re: Seed as private key for ML-DSA and ML… Phillip Hallam-Baker
- [lamps] Re: [EXT] Re: [EXTERNAL] Re: Seed as priv… Blumenthal, Uri - 0553 - MITLL
- [lamps] Re: [EXT] Re: [EXTERNAL] Re: Seed as priv… Blumenthal, Uri - 0553 - MITLL
- [lamps] Re: [EXT] Re: [EXTERNAL] Re: Seed as priv… Mike Ounsworth
- [lamps] Re: [EXT] Re: [EXTERNAL] Re: Seed as priv… Blumenthal, Uri - 0553 - MITLL
- [lamps] Re: [EXT] Re: [EXTERNAL] Re: Seed as priv… Phillip Hallam-Baker
- [lamps] Re: [EXT] Re: [EXTERNAL] Re: Seed as priv… Phillip Hallam-Baker
- [lamps] Re: [EXT] Re: [EXTERNAL] Re: Seed as priv… Deirdre Connolly
- [lamps] Re: [EXT] Re: [EXTERNAL] Re: Seed as priv… Blumenthal, Uri - 0553 - MITLL