Re: [jose] [EXTERNAL] COSE and JOSE Keys for Kyber

Orie Steele <orie@transmute.industries> Tue, 15 November 2022 14:36 UTC

Return-Path: <orie@transmute.industries>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 24F5DC14CF1B for <jose@ietfa.amsl.com>; Tue, 15 Nov 2022 06:36:23 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.095
X-Spam-Level:
X-Spam-Status: No, score=-2.095 tagged_above=-999 required=5 tests=[AC_DIV_BONANZA=0.001, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=transmute.industries
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 g8o0an7Htoky for <jose@ietfa.amsl.com>; Tue, 15 Nov 2022 06:36:18 -0800 (PST)
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 843F2C14CF04 for <jose@ietf.org>; Tue, 15 Nov 2022 06:36:18 -0800 (PST)
Received: by mail-ej1-x629.google.com with SMTP id n20so15908070ejh.0 for <jose@ietf.org>; Tue, 15 Nov 2022 06:36:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=transmute.industries; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=qFyMdjkDsto6XPNWVYba1ILTO+YJKu9xQI8GOn8c5v4=; b=Nz9/2b+iXFHQsuRj6QRepPW3FiIRQoqSC9eODzLWWNszpRdIIMYyRDElVntOSL9O/e 4Oz7HnZTdkiQbUB/zf+3+3Y5rTuwgZIBC5WQdUndWTMiN+kWr9da8cULRg1jTR4QxoSR 9x9XOG1ox5UzJGenhc/SSlfnQe3p6H3lCL87C3WGQj83dfo7yBl/XabawlDMbkKLmObM iTkuTKJH2kyljKmGJ3xxaHr6jbML7zl5q7raAEX49cZg4qK7+5q2z2vYncIpyYwUd3gA TFwtkc87x2qKt+TqjekL8yCeoRt93gVMVlC9T7oiuL9bGOjlpprbvarfu5qMWzvpByxO zivQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qFyMdjkDsto6XPNWVYba1ILTO+YJKu9xQI8GOn8c5v4=; b=8J9LMXoHpv7oluQwgW1Vkg6mHDZp1IhivDcmPIJY881WVO/tmx473YII058Kj1vJXt hh7qYvxOkI2JKQVESfJUwvBhnfESd6/bJvk1RiQRdcrS4bOvA8Z/26Y9rKMP73Zerx7y OgAXvsr2VAXRrq2hDmZwT5Ey/8a0boVYx2TDb9iXsX+3Xh5oCrp1GfIX1kAeCf5/BT1s xjbwYYZlkPBQenP7IUHASENKAfcDG/XRZScBMGnhZ2eoP/UtFMWs1bARqp+ML7/Zn3Pb p6lMH8+GXdZLfBanm7LfcKzDOzdiPfIsJlvaulL2d6x1TnJasASBj6/wHCifGQvQdryU mrXA==
X-Gm-Message-State: ANoB5plWaIchOjcoUByWTT8oSVLAMghAilNhAJ2ihLCo6H8L3me1TvdS ZMICzS636xtWY5RauLaUS+tNy3loR1xjcDImglb4Mg==
X-Google-Smtp-Source: AA0mqf6m9fvcqmnkHtmP5znYGZT2quCRLFR9Hd1F3mcjR4BPAgQ/3suNuWH3X9+UDNeRurBiACUEX3igPEksGzy5qpQ=
X-Received: by 2002:a17:906:a181:b0:79b:f7d6:c2aa with SMTP id s1-20020a170906a18100b0079bf7d6c2aamr13907370ejy.310.1668522975824; Tue, 15 Nov 2022 06:36:15 -0800 (PST)
MIME-Version: 1.0
References: <CAN8C-_LVgq0j5YtFrrO-fWNNXvGSWohQ0874DV5qgfYT4FXT0Q@mail.gmail.com> <CH0PR11MB5739F65FA2EC04B562A96EA69F049@CH0PR11MB5739.namprd11.prod.outlook.com>
In-Reply-To: <CH0PR11MB5739F65FA2EC04B562A96EA69F049@CH0PR11MB5739.namprd11.prod.outlook.com>
From: Orie Steele <orie@transmute.industries>
Date: Tue, 15 Nov 2022 08:36:04 -0600
Message-ID: <CAN8C-_+Uu6dT6x0uDvrSNsj+HNjTbRVDWbWPj_zk58iH3Rbktw@mail.gmail.com>
To: Mike Ounsworth <Mike.Ounsworth@entrust.com>
Cc: cose <cose@ietf.org>, JOSE WG <jose@ietf.org>, "Scott Fluhrer (sfluhrer)" <sfluhrer@cisco.com>
Content-Type: multipart/related; boundary="0000000000004637bc05ed8347f5"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/dUqwzyXi4MoqfwaHTHkRoXaG92g>
Subject: Re: [jose] [EXTERNAL] COSE and JOSE Keys for Kyber
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jose/>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 15 Nov 2022 14:36:23 -0000

Thanks for your feedback, do you have an opinion on the registry point
Ilari made?

Should we put Kyber1024 in the Elliptic Curve Registry maintained by IANA?

Are you proposing we do something like this:

{ kty: Dilithium2, alg: DI2, x, d }
{ kty: Dilithium3, alg: DI3, x, d }
{ kty: Dilithium5, alg: DI5, x, d }

OS

On Tue, Nov 15, 2022 at 8:29 AM Mike Ounsworth <Mike.Ounsworth@entrust.com>
wrote:

> Hi all,
>
>
>
> I admit that I’m an outsider and don’t grok why you need a KTY and an ALG,
> but the naming proposed below seems odd to me.
>
>
>
> I suppose you can group things into “LWE”, “NTRU”, “HASH”, but the various
> LWE schemes do not have interchangeable key types; a Dilithium3 key is a
> Dilithium3 key, you can’t use it with any other algorithm, even within the
> LWE family. So for anyone outside the PQC experts I think this is going to
> cause more confusion than help, ex.: people trying to use a Dilithium key
> with Kyber.encaps(), or whatever.
>
>
>
> I also don’t love “CRYDI3”. Why not just “DI3”? I would vote for a naming
> convention of “2-letter + param set” (which Orie suggested in a private
> email)
>
>
>
> FA512 / FA768 / FA1024 / DI3 / DI5 / KY768 / KY1024 / SP256
>
>
>
> “SPHINCS+-SHAKE-256s-robust” seems obscene, especially if you’re only
> supporting one variant. Do “SP256” or “SP256sr”. Also, I’m not a deep
> SPHINCS+ expert, but the “-robust” is probably overkill for JOSE / COSE. I
> think Scott Fluhrer suggested that it’s even overkill for 30-year windows
> code-signing certs, do “-simple” and save yourself 1/2 the bandwidth.
>
>
>
> ---
> Mike Ounsworth
> Software Security Architect, Entrust
>
>
>
> *From:* Orie Steele <orie@transmute.industries>
> *Sent:* November 13, 2022 3:00 PM
> *To:* cose <cose@ietf.org>; JOSE WG <jose@ietf.org>; Mike Ounsworth <
> Mike.Ounsworth@entrust.com>
> *Subject:* [EXTERNAL] COSE and JOSE Keys for Kyber
>
>
>
> WARNING: This email originated outside of Entrust.
> DO NOT CLICK links or attachments unless you trust the sender and know the
> content is safe.
> ------------------------------
>
> Friends,
>
> Mike O. and I have been discussing the need to represent Kyber keys in
> JOSE and COSE, especially as we prepare to consider their use with HPKE.
>
> Mike P. and I have previously shared a draft for presenting Dilithium,
> Falcon and Sphincs -
> https://datatracker.ietf.org/doc/draft-ietf-cose-post-quantum-signatures/
> <https://urldefense.com/v3/__https:/datatracker.ietf.org/doc/draft-ietf-cose-post-quantum-signatures/__;!!FJ-Y8qCqXTj2!fv6kERm44AJw2Rwx8nmq-c7of45L5FbTjlApg70kVdFzo551o2OaOMS0VfKWXe0n1I_43upzNBY1UhZ8UDuIFXLOHms$>
>
> I reviewed the original registries established in:
> https://www.rfc-editor.org/rfc/rfc7518.html#section-7
> <https://urldefense.com/v3/__https:/www.rfc-editor.org/rfc/rfc7518.html*section-7__;Iw!!FJ-Y8qCqXTj2!fv6kERm44AJw2Rwx8nmq-c7of45L5FbTjlApg70kVdFzo551o2OaOMS0VfKWXe0n1I_43upzNBY1UhZ8UDuIkFE2gTI$>
>
>
>
> I also reviewed the latest "kty" and "alg" registered in
> https://datatracker.ietf.org/doc/html/rfc8778
> <https://urldefense.com/v3/__https:/datatracker.ietf.org/doc/html/rfc8778__;!!FJ-Y8qCqXTj2!fv6kERm44AJw2Rwx8nmq-c7of45L5FbTjlApg70kVdFzo551o2OaOMS0VfKWXe0n1I_43upzNBY1UhZ8UDuIVxp-mn8$>
>
> I'm going to stick to JOSE(ish) notation here, my goal is to get a clear
> answer on
> *"which values for `kty` and `alg` are relevant to kyber". *
> See the latest editor's draft for additional details:
> https://github.com/OR13/draft-steele-cose-kyber
> <https://urldefense.com/v3/__https:/github.com/OR13/draft-steele-cose-kyber__;!!FJ-Y8qCqXTj2!fv6kERm44AJw2Rwx8nmq-c7of45L5FbTjlApg70kVdFzo551o2OaOMS0VfKWXe0n1I_43upzNBY1UhZ8UDuIlrb1NBk$>
> .
>
> First, let's start with what we have today:
>
> - https://www.iana.org/assignments/cose/cose.xhtml
> <https://urldefense.com/v3/__https:/www.iana.org/assignments/cose/cose.xhtml__;!!FJ-Y8qCqXTj2!fv6kERm44AJw2Rwx8nmq-c7of45L5FbTjlApg70kVdFzo551o2OaOMS0VfKWXe0n1I_43upzNBY1UhZ8UDuI7xRKz4s$>
> - https://www.iana.org/assignments/jose/jose.xhtml
> <https://urldefense.com/v3/__https:/www.iana.org/assignments/jose/jose.xhtml__;!!FJ-Y8qCqXTj2!fv6kERm44AJw2Rwx8nmq-c7of45L5FbTjlApg70kVdFzo551o2OaOMS0VfKWXe0n1I_43upzNBY1UhZ8UDuIHk5wYN0$>
>
> { kty: RSA, alg: PS384 / RSAES-OAEP w/ SHA-256}
>
> { kty: RSA, alg: RS384 / RSAES-OAEP w/ SHA-256}
>
> { kty: EC2, crv: P-256, alg: ES256 / ECDH-ES+A256KW }
> { kty: OKP, crv: Ed25519, alg: EdDSA } -
> https://www.rfc-editor.org/rfc/rfc8037#section-2
> <https://urldefense.com/v3/__https:/www.rfc-editor.org/rfc/rfc8037*section-2__;Iw!!FJ-Y8qCqXTj2!fv6kERm44AJw2Rwx8nmq-c7of45L5FbTjlApg70kVdFzo551o2OaOMS0VfKWXe0n1I_43upzNBY1UhZ8UDuI1uryn64$>
>
> { kty: OKP, crv: Bls12381G1, alg: ??? } ...
> https://datatracker.ietf.org/doc/html/draft-ietf-cose-bls-key-representations-01#section-2.1.3
> <https://urldefense.com/v3/__https:/datatracker.ietf.org/doc/html/draft-ietf-cose-bls-key-representations-01*section-2.1.3__;Iw!!FJ-Y8qCqXTj2!fv6kERm44AJw2Rwx8nmq-c7of45L5FbTjlApg70kVdFzo551o2OaOMS0VfKWXe0n1I_43upzNBY1UhZ8UDuIQW72VRU$>
> { kty: HSS-LMS, alg: HSS-LMS }
> { kty: WalnutDSA, alg: WalnutDSA }
>
> Observations:
>
> 1. Although `alg` is optional... It looks especially needed in some cases
> (RSA), and especially not needed in others (HSS-LMS, WalnutDSA)
> 2. We appear to have slowly started to encode "Purpose" in the key type (HSS-LMS
> / WalnutDSA) , which suggests that we are commiting to keeping `alg`
> optional forever, and also acknowledging that it is best to use a key for a
> single purpose.
>
> 3. It is possible to define a key and NOT define any algorithms for it...
> (see bls-key draft above).
> 4. OKP is reserved for Elliptic Curves only.
>
> 5. IANA Registries exist for Elliptic Curves but no other "families" such
> as lattices, stateful hash based schemes, or stateless hash based
> schemes... based on HSS-LMS not attempting to fix this, it seems we are
> ok not establishing new IANA registries for lattice or hash types.
> 6. Walnut encodes parameters as separate values in the key type, but not
> the algorithm name... similar to RSA... which seems like a step backwards
> to me.
>
> Here is a proposal for Kyber keys that aligns with the previous proposals
> and drafts for post quantum signatures:
>
> { kty: LWE, alg: CRYDI5 }
> { kty: LWE, alg: CRYDI3 }
> { kty: LWE, alg: CRYDI2 }
>
> { kty: NTRU, alg: FALCON1024 }
> { kty: NTRU, alg: FALCON512 }
>
> { kty: HASH, alg: SPHINCS+-SHAKE-256s-robust }
>
> { kty: LWE, alg: Kyber-1024 }
> { kty: LWE, alg: Kyber-768 }
> { kty: LWE, alg: Kyber-512 }
>
> Please focus your comments on establishing consensus for relevant values
> for `kty` and `alg`.
>
> Regards,
>
> OS
>
>
>
>
> --
>
> *ORIE STEELE*
>
> Chief Technical Officer
>
> www.transmute.industries
> <https://urldefense.com/v3/__http:/www.transmute.industries__;!!FJ-Y8qCqXTj2!fv6kERm44AJw2Rwx8nmq-c7of45L5FbTjlApg70kVdFzo551o2OaOMS0VfKWXe0n1I_43upzNBY1UhZ8UDuIUR8efA4$>
>
>
>
> [image: Image removed by sender.]
> <https://urldefense.com/v3/__https:/www.transmute.industries__;!!FJ-Y8qCqXTj2!fv6kERm44AJw2Rwx8nmq-c7of45L5FbTjlApg70kVdFzo551o2OaOMS0VfKWXe0n1I_43upzNBY1UhZ8UDuIup8-YOU$>
> *Any email and files/attachments transmitted with it are confidential and
> are intended solely for the use of the individual or entity to whom they
> are addressed. If this message has been sent to you in error, you must not
> copy, distribute or disclose of the information it contains. Please notify
> Entrust immediately and delete the message from your system.*
>


-- 
*ORIE STEELE*
Chief Technical Officer
www.transmute.industries

<https://www.transmute.industries>