<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.24 (Ruby 2.5.1) -->


<!DOCTYPE rfc  [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">

]>


<rfc ipr="pre5378Trust200902" docName="draft-ietf-cose-hpke-03" category="std" consensus="true" tocInclude="true" sortRefs="true" symRefs="true">
  <front>
    <title abbrev="COSE HPKE">Use of Hybrid Public-Key Encryption (HPKE) with CBOR Object Signing and Encryption (COSE)</title>

    <author initials="H." surname="Tschofenig" fullname="Hannes Tschofenig">
      <organization></organization>
      <address>
        <email>hannes.tschofenig@gmx.net</email>
      </address>
    </author>
    <author initials="B." surname="Moran" fullname="Brendan Moran">
      <organization>Arm Limited</organization>
      <address>
        <email>Brendan.Moran@arm.com</email>
      </address>
    </author>

    <date year="2023" month="February" day="27"/>

    <area>Security</area>
    <workgroup>COSE</workgroup>
    <keyword>Internet-Draft</keyword>

    <abstract>


<t>This specification defines hybrid public-key encryption (HPKE) for use with 
CBOR Object Signing and Encryption (COSE). HPKE offers a variant of
public-key encryption of arbitrary-sized plaintexts for a recipient public key.</t>

<t>HPKE works for any combination of an asymmetric key encapsulation mechanism (KEM),
key derivation function (KDF), and authenticated encryption with
additional data (AEAD) function. Authentication for HPKE in COSE is
provided by COSE-native security mechanisms.</t>

<t>This document defines the use of the HPKE base mode with COSE. Other modes are
supported by HPKE but not by this specification.</t>



    </abstract>



  </front>

  <middle>


<section anchor="introduction"><name>Introduction</name>

<t>Hybrid public-key encryption (HPKE) <xref target="RFC9180"/> 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. The motivation for
standardizing a public key encryption scheme is explained in the introduction
of <xref target="RFC9180"/>.</t>

<t>The HPKE specification defines several features for use with public key encryption
and a subset of those features is applied to COSE (<xref target="RFC9052"/>, <xref target="RFC9053"/>). Since COSE provides
constructs for authentication, those are not re-used from the HPKE specification.
This specification uses the "base" mode, as it is called in HPKE specification
language.</t>

</section>
<section anchor="conventions-and-terminology"><name>Conventions and Terminology</name>

<t>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 <xref target="RFC2119"/> <xref target="RFC8174"/>
when, and only when, they appear in all capitals, as shown here.</t>

<t>This specification uses the following abbreviations and terms:
- Content-encryption key (CEK), a term defined in CMS <xref target="RFC2630"/>.
- Hybrid Public Key Encryption (HPKE) is defined in <xref target="RFC9180"/>.
- pkR is the public key of the recipient, as defined in <xref target="RFC9180"/>.
- skR is the private key of the recipient, as defined in <xref target="RFC9180"/>.
- Key Encapsulation Mechanism (KEM), see <xref target="RFC9180"/>.
- Key Derivation Function (KDF), see <xref target="RFC9180"/>.
- Authenticated Encryption with Associated Data (AEAD), see <xref target="RFC9180"/>.</t>

</section>
<section anchor="hpke-for-cose"><name>HPKE for COSE</name>

<section anchor="overview"><name>Overview</name>

<t>This specification supports two uses of HPKE in COSE, namely</t>

<t><list style="symbols">
  <t>HPKE in a single recipient setup.
This use cases uses a one layer COSE structure. 
<xref target="one-layer"/> provides the details.</t>
  <t>HPKE in a multiple recipient setup. 
This use case requires a two layer COSE structure.  <xref target="two-layer"/> 
provides the details. While it is possible to support the single 
recipient use case with a two layer structure, the single 
layer setup is more efficient.</t>
</list></t>

<t>HPKE in "base" mode requires little information to be exchanged between 
a sender and a recipient, namely</t>

<t><list style="symbols">
  <t>algorithm information (KEM, KDF, and AEAD identifiers),</t>
  <t>the encapsulated key structure, and</t>
  <t>an identifier of the static recipient key.</t>
</list></t>

<t>In the subsections below we explain how this information is carried
inside the COSE_Encrypt0 and the COSE_Encrypt for the one layer and the
two layer structure, respectively.</t>

<t>In both cases a new structure is used to convey information about the HPKE
sender, namely the HPKE encapsulated key structure (encapsulated_key).</t>

<t>When the alg value is set to 'HPKE-v1-BASE', the encapsulated key MUST be present in 
the unprotected header parameter and its value MUST be of type encapsulated_key.</t>

<t>The CDDL grammar describing the encapsulated_key structure is:</t>

<figure><artwork><![CDATA[
   encapsulated_key = [
       kem_id : uint,         ; kem identifier
       kdf_id : uint,         ; kdf identifier
       aead_id : uint,        ; aead identifier
       enc : bstr,            ; encapsulated key
   ]
]]></artwork></figure>

<figure title="encapsulated_key structure" anchor="_table-hpke-sender"><artwork><![CDATA[
   +---------+----------------+------------+-------------------+
   | Name    | CBOR Type      | Value      | Description       |
   |         |                | Registry   |                   |
   +---------+----------------+------------+-------------------+
   | kem_id  | uint           | HPKE       | Identifier for    |
   |         |                | KEM IDs    | the KEM           |
   |         |                | Registry   |                   |
   |         |                |            |                   |
   | kdf_id  | uint           | HPKE KDF   | Identifier for    |
   |         |                | IDs        | the KDF ID        |
   |         |                |            |                   |
   | aead_id | uint           | HPKE AEAD  | Identifier for    |
   |         |                | IDs        | the AEAD ID       |
   |         |                |            |                   |
   | enc     | bstr           |            | Encapsulated key  |
   |         |                |            | defined by HPKE   |
   +---------+----------------+------------+-------------------+
]]></artwork></figure>

<t>kem_id: This parameter is used to identify the KEM. The registry
       for KEM ids has been established with RFC 9180.</t>

<t>kdf_id: This parameter contains the KDF identifier. 
   The registry containing the KDF ids has been established with RFC 9180.</t>

<t>aead_id: This parameter contains the AEAD identifier. The registry 
   containing the AEAD ids has been established with RFC 9180.</t>

<t>enc: This parameter contains the encapsulated key, which is output
      of the HPKE KEM.</t>

<section anchor="one-layer"><name>Single Recipient / One Layer Structure</name>

<t>With the one layer structure the information carried inside the 
COSE_recipient structure is embedded inside the COSE_Encrypt0.</t>

<t>HPKE is used to directly encrypt the plaintext. The resulting ciphertext
may be included in the COSE_Encrypt0 or may be detached.</t>

<t>The sender MUST set the alg parameter in the protected header, which
indicates the use of HPKE.</t>

<t>The sender MUST place the kid parameter and the encapsulated_key structure
into the unprotected header. The kid identifies the static recipient
public key used by the sender. The recipient uses the kid to determine
the appropriate private key.</t>

<t><xref target="cddl-hpke-one-layer"/> shows the COSE_Encrypt0 CDDL structure.</t>

<figure title="CDDL for HPKE-based COSE_Encrypt0 Structure" anchor="cddl-hpke-one-layer"><artwork><![CDATA[
COSE_Encrypt0_Tagged = #6.16(COSE_Encrypt0)

; Layer 0
COSE_Encrypt0 = [
    Headers,
    ciphertext : bstr / nil,
]
]]></artwork></figure>

<t>The COSE_Encrypt0 MAY be tagged or untagged.</t>

<t>An example is shown in <xref target="one-layer-example"/>.</t>

</section>
<section anchor="two-layer"><name>Multiple Recipients / Two Layer Structure</name>

<t>With the two layer structure the HPKE information is conveyed in the COSE_recipient 
structure, i.e. one COSE_recipient structure per recipient.</t>

<t>In this approach the following layers are involved:</t>

<t><list style="symbols">
  <t>Layer 0 (corresponding to the COSE_Encrypt structure) contains the content (plaintext)
encrypted with the CEK. This ciphertext MAY be detached. If not detached, then
it is included in the COSE_Encrypt structure.</t>
  <t>Layer 1 (corresponding to a recipient structure) contains parameters needed for 
HPKE to generate a shared secret used to encrypt the CEK. This layer conveys the 
encrypted CEK in the encCEK structure. The protected header MUST contain the HPKE 
alg parameter and the unprotected header MUST contain the encapsulated_key structure
as well as the kid parameter to identify the static recipient public key the sender
has been using with HPKE.</t>
</list></t>

<t>This two-layer structure is used to encrypt content that can also be shared with
multiple parties at the expense of a single additional encryption operation.
As stated above, the specification uses a CEK to encrypt the content at layer 0.
For example, the content encrypted at layer 0 may be a firmware image.  The
same encrypted firmware image may need to be sent to many recipients;
however, each recipient uses their own private key to obtain the CEK.</t>

<t>The COSE_recipient structure, shown in <xref target="cddl-hpke"/>, is repeated for each
recipient.</t>

<figure title="CDDL for HPKE-based COSE_Encrypt Structure" anchor="cddl-hpke"><artwork><![CDATA[
COSE_Encrypt_Tagged = #6.96(COSE_Encrypt)
 
/ Layer 0 /
COSE_Encrypt = [
  Headers,
  ciphertext : bstr / nil,
  recipients : + COSE_recipient
]

/ Layer 1 /
COSE_recipient = [
  protected   : bstr .cbor header_map,
  unprotected : header_map,
  encCEK      : bstr,
]

header_map = {
  Generic_Headers,
  * label => values,
}
]]></artwork></figure>

<t>The COSE_Encrypt MAY be tagged or untagged.</t>

<t>An example is shown in <xref target="two-layer-example"/>.</t>

</section>
</section>
<section anchor="hpke-encryption-with-sealbase"><name>HPKE Encryption with SealBase</name>

<t>The SealBase(pkR, info, aad, pt) function is used to encrypt a plaintext pt to
a recipient's public key (pkR).</t>

<t>IMPORTANT: For use in COSE_Encrypt, 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. In case of COSE_Encrypt0, the plaintext 
"pt" passed into the SealBase is the raw plaintext.</t>

<t>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. This specification does not mandate the use of the info and the aad
parameters. Application-specific profiles of this specification MAY mandate
the use of the info and the aad parameters.</t>

<t>If SealBase() is successful, it will output a ciphertext "ct" and an encapsulated
key "enc".</t>

<t>The content of the info parameter is based on the 'COSE_KDF_Context' structure,
which is detailed in <xref target="cddl-cose-kdf"/>.</t>

</section>
<section anchor="hpke-decryption-with-openbase"><name>HPKE Decryption with OpenBase</name>

<t>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 used 
as mandated by an application-specific profile of this specification.</t>

<t>The OpenBase function will, if successful, decrypt "ct". When decrypted, the result
will be either the CEK (if using COSE_Encrypt), or the raw plaintext (if using 
COSE_Encrypt0). The CEK is the symmetric key used to decrypt the ciphertext in 
layer 0.</t>

</section>
<section anchor="info-structure"><name>Info Structure</name>

<t>This section provides a suggestion for constructing the info structure, when used with
SealBase() and OpenBase(). Note that the use of the aad and the info structures for these
two functions is optional. Profiles of this specification MAY require their use and may
define different info structure.</t>

<t>This specification re-uses the context information structure defined in
<xref target="RFC9053"/> as a foundation for the info structure. This payload becomes the content
of the info parameter for the HPKE functions, when utilized. For better readability of
this specification the COSE_KDF_Context structure is repeated in <xref target="cddl-cose-kdf"/>.</t>

<figure title="COSE_KDF_Context Data Structure for info parameter" anchor="cddl-cose-kdf"><artwork><![CDATA[
   PartyInfo = (
       identity : bstr / nil,
       nonce : bstr / int / nil,
       other : bstr / nil
   )

   COSE_KDF_Context = [
       AlgorithmID : int / tstr,
       PartyUInfo : [ PartyInfo ],
       PartyVInfo : [ PartyInfo ],
       SuppPubInfo : [
           keyDataLength : uint,
           protected : empty_or_serialized_map,
           ? other : bstr
       ],
       ? SuppPrivInfo : bstr
   ]
]]></artwork></figure>

</section>
</section>
<section anchor="examples"><name>Examples</name>

<section anchor="one-layer-example"><name>Single Recipient / One Layer Example</name>

<t>This example assumes that a sender wants to communicate an
encrypted payload to a single recipient in the most efficient way.</t>

<t>An example of the COSE_Encrypt0 structure using the HPKE scheme is
shown in <xref target="hpke-example-one"/>. Line breaks and comments have been inserted
for better readability.</t>

<t>It uses the following algorithm combination: 
- KEM: DHKEM(P-256, HKDF-SHA256)
- KDF: HKDF-SHA256
- AEAD: AES-128-GCM</t>

<figure title="COSE_Encrypt0 Example for HPKE" anchor="hpke-example-one"><artwork><![CDATA[
// payload: "This is the content", aad: ""
// 
16([
    h'a10120',  // alg = HPKE-v1-BASE
    {
        4: h'3031', // kid
        -4: [       // encapsulated_key
            16,     // kem = DHKEM(P-256, HKDF-SHA256)
            1,      // kdf = HKDF-SHA256
            1,      // aead = AES-128-GCM
            h'048c6f75e463a773082f3cb0d3a701348a578c67
              80aba658646682a9af7291dfc277ec93c3d58707
              818286c1097825457338dc3dcaff367e2951342e
              9db30dc0e7',  // enc
        ],
    },
    / encrypted plaintext /
    h'ee22206308e478c279b94bb071f3a5fbbac412a6effe34195f7
      c4169d7d8e81666d8be13',
])
]]></artwork></figure>

</section>
<section anchor="two-layer-example"><name>Multiple Recipients / Two Layer</name>

<t>In this example we assume that a sender wants to transmit a
payload to two recipients using the two-layer structure.
Note that it is possible to send two single-layer payloads, 
although it will be less efficient.</t>

<t>An example of the COSE_Encrypt structure using the HPKE scheme is
shown in <xref target="hpke-example-two"/>. Line breaks and comments have been inserted
for better readability.</t>

<t>It uses the following algorithm combination:</t>

<t><list style="symbols">
  <t>At layer 0 AES-128-GCM is used for encryption of the detached plaintext
"This is the content.".</t>
  <t>At the recipient structure at layer 1, DHKEM(P-256, HKDF-SHA256)
(as the KEM), with AES-128-GCM (as the AEAD) and HKDF-SHA256
(as the KDF) is used.</t>
</list></t>

<t>The algorithm selection is based on the registry of the values offered
by the alg parameters (see <xref target="IANA"/>).</t>

<figure title="COSE_Encrypt Example for HPKE" anchor="hpke-example-two"><artwork><![CDATA[
// plaintext: "This is the content.", aad: ""
96_0([
    h'a10101',  // alg = AES-128-GCM (1)
    {5: h'67303696a1cc2b6a64867096'},  // iv
    h'',        // detached ciphertext
    [
        [
            h'a10120',  // alg = HPKE-v1-BASE (-1 #TBD)
            {
                4: h'3031', // kid
                -4: [       // encapsulated_key
                    16,     // kem = DHKEM(P-256, HKDF-SHA256)
                    1,      // kdf = HKDF-SHA256
                    1,      // aead = AES-128-GCM
                    / enc output /
                    h'0421ccd1b00dd958d77e10399c
                         97530fcbb91a1dc71cb3bf41d9
                         9fd39f22918505c973816ecbca
                         6de507c4073d05cceff73e0d35
                         f60e2373e09a9433be9e95e53c',
                ],
            },
            // ciphertext containing encrypted CEK
            h'bb2f1433546c55fb38d6f23f5cd95e1d72eb4
              c129b99a165cd5a28bd75859c10939b7e4d',
        ],

        [
            h'a10120',  // alg = HPKE-v1-BASE (-1 #TBD)
            {
                4: h'313233', // kid
                -4: [       // encapsulated_key
                    16,     // kem = DHKEM(P-256, HKDF-SHA256)
                    1,      // kdf = HKDF-SHA256
                    1,      // aead = AES-128-GCM
                    / enc output /
                       h'6de507c4073d05cceff73e0d35
                         f60e2373e09a9433be9e95e53c
                         9fd39f22918505c973816ecbca
                         6de507c4073d05cceff73e0d35
                         f60e2373e09a9433be9e95e53c',
                ],
            },
            // ciphertext containing encrypted CEK
            h'c4169d7d8e81666d8be13bb2f1433546c55fb
              c129b99a165cd5a28bd75859c10939b7e4d',
        ]        
    ],
])
]]></artwork></figure>

<t>To offer authentication of the sender the payload in <xref target="hpke-example-two"/>
is signed with a COSE_Sign1 wrapper, which is shown in <xref target="hpke-example-sign"/>.
The payload in <xref target="hpke-example-sign"/> corresponds to the content shown in
<xref target="hpke-example-two"/>.</t>

<figure title="COSE_Encrypt Example for HPKE" anchor="hpke-example-sign"><artwork><![CDATA[
18(
  [
    / protected / h'a10126' / {
            \ alg \ 1:-7 \ ECDSA 256 \
          } / ,
    / unprotected / {
          / kid / 4:'sender@example.com'
        },
    / payload /     h'AA19...B80C',
    / signature /   h'E3B8...25B8'
  ]
)
]]></artwork></figure>

</section>
</section>
<section anchor="sec-cons"><name>Security Considerations</name>

<t>This specification is based on HPKE and the security considerations of HPKE
<xref target="RFC9180"/> are therefore applicable also to this specification.</t>

<t>HPKE assumes the sender is in possession of the public key of the recipient and
HPKE COSE makes the same assumptions. Hence, some form of public key distribution
mechanism is assumed to exist.</t>

<t>HPKE relies on a source of randomness to be available on the device. Additionally, 
with the two layer structure the CEK is randomly generated and the it MUST be
ensured that the guidelines for random number generations are followed.</t>

<t>The COSE_Encrypt structure MUST be authenticated using COSE constructs like 
COSE_Sign, COSE_Sign1, COSE_MAC, or COSE_MAC0.</t>

<t>When COSE_Encrypt or COSE_Encrypt0 is used with a detached ciphertext then the
subsequently applied integrity protection via COSE_Sign, COSE_Sign1, COSE_MAC, 
or COSE_MAC0 does not cover this detached ciphertext. Implementers MUST ensure
that the detached ciphertext also experiences integrity protection. This is, for
example, the case when an AEAD cipher is used to produce the detached ciphertext
but may not be guaranteed by non-AEAD ciphers.</t>

</section>
<section anchor="IANA"><name>IANA Considerations</name>

<t>This document requests IANA to add new values to the 'COSE Algorithms' and to 
the 'COSE Header Algorithm Parameters' registries in the 'Standards Action 
With Expert Review category.</t>

<section anchor="cose-algorithms-registry"><name>COSE Algorithms Registry</name>

<t><list style="symbols">
  <t>Name: HPKE-v1-BASE</t>
  <t>Value: TBD1 (Assumed: -1)</t>
  <t>Description: HPKE in version 1 in base mode for use with COSE</t>
  <t>Capabilities: [kty]</t>
  <t>Change Controller: IESG</t>
  <t>Reference:  [[TBD: This RFC]]</t>
  <t>Recommended: Yes</t>
</list></t>

</section>
<section anchor="cose-header-algorithm-parameters"><name>COSE Header Algorithm Parameters</name>

<t><list style="symbols">
  <t>Name: encapsulated_key</t>
  <t>Label: TBD2 (Assumed: -4)</t>
  <t>Value type: encapsulated_key</t>
  <t>Value Registry: N/A</t>
  <t>Description: Encapsulated key for KEM-like algorithms</t>
</list></t>

</section>
</section>


  </middle>

  <back>


    <references title='Normative References'>





<reference anchor='RFC2119'>
<front>
<title>Key words for use in RFCs to Indicate Requirement Levels</title>
<author fullname='S. Bradner' initials='S.' surname='Bradner'><organization/></author>
<date month='March' year='1997'/>
<abstract><t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t></abstract>
</front>
<seriesInfo name='BCP' value='14'/>
<seriesInfo name='RFC' value='2119'/>
<seriesInfo name='DOI' value='10.17487/RFC2119'/>
</reference>



<reference anchor='RFC8174'>
<front>
<title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
<author fullname='B. Leiba' initials='B.' surname='Leiba'><organization/></author>
<date month='May' year='2017'/>
<abstract><t>RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t></abstract>
</front>
<seriesInfo name='BCP' value='14'/>
<seriesInfo name='RFC' value='8174'/>
<seriesInfo name='DOI' value='10.17487/RFC8174'/>
</reference>



<reference anchor='RFC9180'>
<front>
<title>Hybrid Public Key Encryption</title>
<author fullname='R. Barnes' initials='R.' surname='Barnes'><organization/></author>
<author fullname='K. Bhargavan' initials='K.' surname='Bhargavan'><organization/></author>
<author fullname='B. Lipp' initials='B.' surname='Lipp'><organization/></author>
<author fullname='C. Wood' initials='C.' surname='Wood'><organization/></author>
<date month='February' year='2022'/>
<abstract><t>This document describes a scheme for hybrid public key encryption (HPKE). This scheme provides a variant of public key encryption of arbitrary-sized plaintexts for a recipient public key. It also includes three authenticated variants, including one that authenticates possession of a pre-shared key and two optional ones that authenticate possession of a key encapsulation mechanism (KEM) private key. HPKE works for any combination of an asymmetric KEM, key derivation function (KDF), and authenticated encryption with additional data (AEAD) encryption function. Some authenticated variants may not be supported by all KEMs. We provide instantiations of the scheme using widely used and efficient primitives, such as Elliptic Curve Diffie-Hellman (ECDH) key agreement, HMAC-based key derivation function (HKDF), and SHA2.</t><t>This document is a product of the Crypto Forum Research Group (CFRG) in the IRTF.</t></abstract>
</front>
<seriesInfo name='RFC' value='9180'/>
<seriesInfo name='DOI' value='10.17487/RFC9180'/>
</reference>



<reference anchor='RFC9052'>
<front>
<title>CBOR Object Signing and Encryption (COSE): Structures and Process</title>
<author fullname='J. Schaad' initials='J.' surname='Schaad'><organization/></author>
<date month='August' year='2022'/>
<abstract><t>Concise Binary Object Representation (CBOR) is a data format designed for small code size and small message size.  There is a need to be able to define basic security services for this data format.  This document defines the CBOR Object Signing and Encryption (COSE) protocol.  This specification describes how to create and process signatures, message authentication codes, and encryption using CBOR for serialization.  This specification additionally describes how to represent cryptographic keys using CBOR.  </t><t>This document, along with RFC 9053, obsoletes RFC 8152.</t></abstract>
</front>
<seriesInfo name='STD' value='96'/>
<seriesInfo name='RFC' value='9052'/>
<seriesInfo name='DOI' value='10.17487/RFC9052'/>
</reference>



<reference anchor='RFC9053'>
<front>
<title>CBOR Object Signing and Encryption (COSE): Initial Algorithms</title>
<author fullname='J. Schaad' initials='J.' surname='Schaad'><organization/></author>
<date month='August' year='2022'/>
<abstract><t>Concise Binary Object Representation (CBOR) is a data format designed for small code size and small message size. There is a need to be able to define basic security services for this data format. This document defines a set of algorithms that can be used with the CBOR Object Signing and Encryption (COSE) protocol (RFC 9052). </t><t>This document, along with RFC 9052, obsoletes RFC 8152.</t></abstract>
</front>
<seriesInfo name='RFC' value='9053'/>
<seriesInfo name='DOI' value='10.17487/RFC9053'/>
</reference>




    </references>

    <references title='Informative References'>





<reference anchor='RFC8937'>
<front>
<title>Randomness Improvements for Security Protocols</title>
<author fullname='C. Cremers' initials='C.' surname='Cremers'><organization/></author>
<author fullname='L. Garratt' initials='L.' surname='Garratt'><organization/></author>
<author fullname='S. Smyshlyaev' initials='S.' surname='Smyshlyaev'><organization/></author>
<author fullname='N. Sullivan' initials='N.' surname='Sullivan'><organization/></author>
<author fullname='C. Wood' initials='C.' surname='Wood'><organization/></author>
<date month='October' year='2020'/>
<abstract><t>Randomness is a crucial ingredient for Transport Layer Security (TLS) and related security protocols.  Weak or predictable &quot;cryptographically secure&quot; pseudorandom number generators (CSPRNGs) can be abused or exploited for malicious purposes. An initial entropy source that seeds a CSPRNG might be weak or broken as well, which can also lead to critical and systemic security problems. This document describes a way for security protocol implementations to augment their CSPRNGs using long-term private keys. This improves randomness from broken or otherwise subverted CSPRNGs.</t><t>This document is a product of the Crypto Forum Research Group (CFRG) in the IRTF.</t></abstract>
</front>
<seriesInfo name='RFC' value='8937'/>
<seriesInfo name='DOI' value='10.17487/RFC8937'/>
</reference>



<reference anchor='RFC2630'>
<front>
<title>Cryptographic Message Syntax</title>
<author fullname='R. Housley' initials='R.' surname='Housley'><organization/></author>
<date month='June' year='1999'/>
<abstract><t>This document describes the Cryptographic Message Syntax.  This syntax is used to digitally sign, digest, authenticate, or encrypt arbitrary messages.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='2630'/>
<seriesInfo name='DOI' value='10.17487/RFC2630'/>
</reference>




    </references>


<section anchor="contributors"><name>Contributors</name>

<t>We would like thank the following individuals for their contributions
to the design of embedding the HPKE output into the COSE structure 
following a long and lively mailing list discussion.</t>

<t><list style="symbols">
  <t>Daisuke Ajitomi</t>
  <t>Richard Barnes</t>
  <t>Ilari Liusvaara</t>
</list></t>

<t>Finally, we would like to thank Russ Housley for his contributions to
the draft as a co-author of initial versions.</t>

</section>
<section anchor="acknowledgements"><name>Acknowledgements</name>

<t>We would like to thank John Mattsson, Mike Prorock, Michael Richardson,
Goeran Selander, Laurence Lundblade and Orie Steele for their review feedback.</t>

</section>


  </back>

<!-- ##markdown-source:
H4sIAMHY/GMAA+1cWXPbSJJ+r19RIUespBmS5iGeHd5pWpJbWkuWV1JPR4fb
oSgARREjEODgkMzWqn/7ZmYdKICQ7Onu2H0ZPtgkUEdWHl8eVaV2u83yMI/k
jP+YSZ4s+MnGS8OAfyy8KPTb7+WGH8d+ulnnYRLzvZOP74/3+UOYL/nh24tL
fuH9Q/o5vwpv4zC+5SIOKs0PL66O95nwvFTezzj+4jgCCxI/FiuYNEjFIm+H
Ml+0/SST7eX6Tra7A+aLXN4m6WbGszxgLFynM75O5XAwnlynRZb3u91pt89E
KsWMX0m/SMN8wx6S9O42TYq1movdyQ08Cmb8NM5lGsu8fYTzMZblQOmNiJIY
aNjIjK3DGf+UJ36LZ0map3KRwbfNCr98ZkwU+TJJZ4y3GVefMM5m/KTDrzN/
mSxkHN6aN2pdJyKOZdbwOklvRRz+KpA/M26eypUIoxlfUq9Obnt9f7v60gG6
WTk1zfy2w8+TVMTMnfNtKuNAxJU31enm6YqfhaswlwGrTKy7dqjr9yJddfxk
xRiLk3QFfe8lrJ1fvjvs93pT/XXSGx/or9PepGu+dof98usAv7IwXtSGmUwH
YzPiaEB9Wbvd5sLL8lT4sNzrZZjxbC39cBH6RD0P5CJEni6Vgq6VgoKIudxS
UJiQF6DPpKjsmzW1Q9oJVrCQacYFvxdpKOIcHrDm6cBeROqFQHS6aWfhrxLo
ikQI2vYlz4gKwV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