Internet-Draft | COSE HPKE | January 2022 |
Tschofenig, et al. | Expires 14 July 2022 | [Page] |
This specification defines hybrid public-key encryption (HPKE) for use with CBOR Object Signing and Encryption (COSE).¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 14 July 2022.¶
Copyright (c) 2022 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.¶
Hybrid public-key encryption (HPKE) [I-D.irtf-cfrg-hpke] is a scheme that provides public key encryption of arbitrary-sized plaintexts given a recipient's public key. HPKE utilizes a non-interactive ephemeral-static Diffie-Hellman exchange to establish a shared secret, which is then used to encrypt plaintext.¶
The HPKE specification defines several features for use with public key encryption and a subset of those features is applied to COSE [RFC8152]. Since COSE provides constructs for authenticcation, those are not re-used from the HPKE specification. This specification uses the "base" mode (as it is called in HPKE specification language).¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This specification uses the following abbreviations and terms: - Content-encryption key (CEK), a term defined in RFC 2630 [RFC2630]. - Hybrid Public Key Encryption (HPKE) is defined in [I-D.irtf-cfrg-hpke]. - pkR is the public key of the recipient, as defined in [I-D.irtf-cfrg-hpke]. - skR is the private key of the recipient, as defined in [I-D.irtf-cfrg-hpke].¶
The CDDL for the COSE_Encrypt structure, as used with this specification, is shown in Figure 1. The structures referenced below are found in the CDDL.¶
HPKE, when used with COSE, follows a three layer structure:¶
The COSE_recipient_outer structure shown in Figure 1 includes the encrypted CEK (in the encCEK structure) and the COSE_recipient_inner structure, also shown in Figure 1, contains the ephemeral public key (in the unprotected structure).¶
The SealBase(pkR, info, aad, pt) function is used to encrypt a plaintext pt to a recipient's public key (pkR). For use in this specification, the plaintext "pt" passed into the SealBase is the CEK. The CEK is a random byte sequence of length appropriate for the encryption algorithm selected in layer 0. For example, AES-128-GCM requires a 16 byte key and the CEK would therefore be 16 bytes long.¶
The "info" parameter can be used to influence the generation of keys and the "aad" parameter provides additional authenticated data to the AEAD algorithm in use. If successful, SealBase() will output a ciphertext "ct" and an encapsulated key "enc". The content of enc is the ephemeral public key.¶
The content of the info parameter is based on the 'COSE_KDF_Context' structure, which is detailed in Figure 2.¶
The recipient will use the OpenBase(enc, skR, info, aad, ct) function with the enc and ct parameters received from the sender. The "aad" and the "info" parameters are obtained via the context of the usage.¶
The OpenBase function will, if successful, decrypt "ct". When decrypted, the result will be the CEK. The CK is the symmetric key used to decrypt the ciphertext in the COSE_Encrypt structure.¶
This specification re-uses the context information structure defined in [RFC8152] for use with the HPKE algorithm. This payload becomes the content of the info parameter for the HPKE functions. For better readability of this specification the COSE_KDF_Context structure is repeated in Figure 2.¶
Since this specification may be used in a number of different deployment environments flexibility for populating the fields in the COSE_KDF_Context structure is provided.¶
For better interoperability, the following recommended settings are provided:¶
An example of the COSE_Encrypt structure using the HPKE scheme is shown in Figure 3. It uses the following algorithm combination:¶
This specification is based on HPKE and the security considerations of HPKE [I-D.irtf-cfrg-hpke] are therefore applicable also to this specification.¶
HPKE assumes that the sender is in possession of the public key of the recipient. A system using HPKE COSE has to assume the same assumptions and public key distribution mechanism is assumed to exist.¶
Since the CEK is randomly generated it must be ensured that the guidelines for random number generations are followed, see [RFC8937].¶
The SUIT_Encryption_Info structure shown in this document does not provide authentication. Hence, the SUIT_Encryption_Info structure has to be used in combination with other COSE constructs, such as the COSE_Sign or COSE_Sign1.¶
This document requests IANA to create new entries in the COSE Algorithms registry established with [RFC8152].¶
+-------------+-------+---------+------------+--------+---------------+ | Name | Value | KDF | Ephemeral- | Key | Description | | | | | Static | Wrap | | +-------------+-------+---------+------------+--------+---------------+ | HPKE/P-256+ | TBD1 | HKDF - | yes | none | HPKE with | | HKDF-256 | | SHA-256 | | | ECDH-ES | | | | | | | (P-256) + | | | | | | | HKDF-256 | +-------------+-------+---------+------------+--------+---------------+ | HPKE/P-384+ | TBD2 | HKDF - | yes | none | HPKE with | | HKDF-SHA384 | | SHA-384 | | | ECDH-ES | | | | | | | (P-384) + | | | | | | | HKDF-384 | +-------------+-------+---------+------------+--------+---------------+ | HPKE/P-521+ | TBD3 | HKDF - | yes | none | HPKE with | | HKDF-SHA521 | | SHA-521 | | | ECDH-ES | | | | | | | (P-521) + | | | | | | | HKDF-521 | +-------------+-------+---------+------------+--------+---------------+ | HPKE | TBD4 | HKDF - | yes | none | HPKE with | | X25519 + | | SHA-256 | | | ECDH-ES | | HKDF-SHA256 | | | | | (X25519) + | | | | | | | HKDF-256 | +-------------+-------+---------+------------+--------+---------------+ | HPKE | TBD4 | HKDF - | yes | none | HPKE with | | X448 + | | SHA-512 | | | ECDH-ES | | HKDF-SHA512 | | | | | (X448) + | | | | | | | HKDF-512 | +-------------+-------+---------+------------+--------+---------------+¶
TBD: Add your name here.¶