Re: [jose] [COSE] JOSE/COSE RSA Kem without HPKE?

Russ Housley <housley@vigilsec.com> Mon, 12 February 2024 19:16 UTC

Return-Path: <housley@vigilsec.com>
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 672DAC14F5F8; Mon, 12 Feb 2024 11:16:15 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.886
X-Spam-Level:
X-Spam-Status: No, score=-1.886 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_KAM_HTML_FONT_INVALID=0.01, T_REMOTE_IMAGE=0.01, 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 kQAWcCGGAJ7q; Mon, 12 Feb 2024 11:16:11 -0800 (PST)
Received: from mail3.g24.pair.com (mail3.g24.pair.com [66.39.134.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 C2EE3C151556; Mon, 12 Feb 2024 11:15:56 -0800 (PST)
Received: from mail3.g24.pair.com (localhost [127.0.0.1]) by mail3.g24.pair.com (Postfix) with ESMTP id 2BE498CC4A; Mon, 12 Feb 2024 14:15:56 -0500 (EST)
Received: from smtpclient.apple (unknown [96.241.2.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail3.g24.pair.com (Postfix) with ESMTPSA id 0B7468CDE8; Mon, 12 Feb 2024 14:15:56 -0500 (EST)
From: Russ Housley <housley@vigilsec.com>
Message-Id: <720DC088-EC9A-4E67-88CD-A25BEE3B180C@vigilsec.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_EFA9DC01-E481-4BD7-A02C-362F44D94369"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\))
Date: Mon, 12 Feb 2024 14:15:45 -0500
In-Reply-To: <CAN8C-_LgRdZ-vXFDQJSghKBfJ_gGZWaUE2+qX63faLdnTHSGGg@mail.gmail.com>
Cc: cose <cose@ietf.org>, JOSE WG <jose@ietf.org>
To: Orie Steele <orie@transmute.industries>, Ilari Liusvaara <ilariliusvaara@welho.com>
References: <CAN8C-_LgRdZ-vXFDQJSghKBfJ_gGZWaUE2+qX63faLdnTHSGGg@mail.gmail.com>
X-Mailer: Apple Mail (2.3731.700.6)
X-Scanned-By: mailmunge 3.11 on 66.39.134.11
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/DQ5o_x8LEHrhXnHC48JHE_aS3t8>
Subject: Re: [jose] [COSE] JOSE/COSE RSA Kem without HPKE?
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: Mon, 12 Feb 2024 19:16:15 -0000

Orie:

I do not know if people see a need for KEM outside of HPKE in COSE and/or JOSE.  However, if they do, we want to specify it in a way that allows a crypto library to support it and CMS KEMRecipientInfo with the same API.

Russ


> On Feb 12, 2024, at 1:41 PM, Orie Steele <orie@transmute.industries> wrote:
> 
> See https://datatracker.ietf.org/doc/draft-ietf-lamps-rfc5990bis/
> 
> Do we expect to see RSA Kem support in JOSE and COSE without the use of HPKE?
> 
> If so, how do we identify RSA keys for use with KEMS? How do we transport KEM CT ?
> 
> One option would be to reuse what we have in the JOSE HPKE draft, to transport the KEM CT as an ephemeral encapsulated key:
> 
> {
>   "protected": "eyJlbmMiOiJBMTI4R0NNIn0",
>   "encrypted_key": "W0nlNK0VztBrVSJo23vNEPcUKbSgRWYaisRpeAqHw5M",
>   "iv": "BvmzuI3ign3WgUVs",
>   "ciphertext": "1iqtwexTYT9lsxppkWVs...Udc0KgLXGvD4l8q_LVvodF",
>   "tag": "fJ1Mq0pP1j_ZrNP2kXDUsw",
>   "aad": "8J-SgCBhYWQ",
>   "recipients": [
>     {
>       "encrypted_key": "W0nlNK0VztBrVSJo23vNEPcUKbSgRWYaisRpeAqHw5M",
>       "header": {
>         "kid": "urn:ietf:params:oauth:jwk-thumbprint:sha-256:iCUZEezL_1kx3t3y9i_AW0LIOmojwr2tBgih7RCy-kE",
>         "alg": "HPKE-Base-P256-SHA256-AES128GCM",
>         "epk": {
>           "kty": "EK", // encapsulated key type
>           "ek": "BN1YNlivxeS3DayvCt...3HDoa1Orh1wqPmw3Pp6Y" // encapsulated key
>         }
>       }
>     },
>     // RSA KEM example goes here... looks like HPKE example above?
>     {
>       "encrypted_key": "B9X-TifYXbA0fKHpASFT4N1_sLMf1...VmWjVhkfgaOvS9VCOzepEM02jFA",
>       "header": {
>         "alg": "RSA-OAEP-384"
>       }
>     },
>     {
>       "encrypted_key": "MRtJFqzpSDoLwS2AW13dbuGcPWrnRl-r",
>       "header": {
>         "kid": "urn:ietf:params:oauth:jwk-thumbprint:sha-256:qXy7xVrE0xm3tS9ilK74GadeD9HF1wnQUzY5ml4pWuY",
>         "alg": "ECDH-ES+A128KW",
>         "epk": {
>           "kty": "EC",
>           "crv": "P-256",
>           "x": "YzBl6tEBdqvkDxcGS7SWePD-oI4J9jMQX6qh3k7lGTw",
>           "y": "s8D6l21rlSCH5IZZF4kjPwGhcoHg3ENGSup3VpE7o_8"
>         }
>       }
>     }
>   ]
> }
> 
> or:
> 
> {
>         / kid /
>         4: h'3031',
>         / encapsulated_key /
>         -4: h'045df...73e', // new cose header, since cose does not support transporting encapsulated keys as "epk" (-1).
> },
> 
> 
> Similar to the discussions we have had for ECDH-ES+A128KW vs HPKE, let us start a discussion for
> 
> RSAES-OAEP w/ SHA-256 vs HPKE or Plain RSA Kem (TBD)
> 
> - https://www.rfc-editor.org/rfc/rfc7518.html#section-4.3
> - https://www.rfc-editor.org/rfc/rfc8230.html#section-3
> 
> The reason I raise this, is that Ilari mentioned wanting to use JOSE HPKE's Integrated Encryption and Key Encryption modes, without HPKE but with other KEMs, so considering how RSA Kem might be supported in JOSE and COSE seems worth discussing.
> 
> Is it ok if JOSE uses "epk" and JWK, COSE uses a new header parameter instead of using "epk" and COSE Key?
> 
> Should JOSE do as COSE is doing? or vice versa?
> 
> Regards,
> 
> OS
> 
> -- 
> 
> ORIE STEELE
> Chief Technology Officer
> www.transmute.industries
>  <https://transmute.industries/>
> _______________________________________________
> COSE mailing list
> COSE@ietf.org
> https://www.ietf.org/mailman/listinfo/cose