rfc9054.original.xml   rfc9054.xml 
<?xml version='1.0' encoding='utf-8'?> <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> <!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<?rfc toc="yes"?> <!-- draft submitted in xml v3 -->
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?> <rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902"
<?rfc comments="yes"?> docName="draft-ietf-cose-hash-algs-09" number="9054"
<rfc ipr="trust200902" docName="draft-ietf-cose-hash-algs-09" category="info" ve submissionType="IETF" category="info" consensus="true" tocInclude="true"
rsion="3" submissionType="IETF"> symRefs="true" sortRefs="true" xml:lang="en" version="3">
<front> <front>
<title abbrev="COSE Hashes">CBOR Object Signing and Encryption (COSE): Hash Algorithms</title> <title abbrev="COSE Hashes">CBOR Object Signing and Encryption (COSE): Hash Algorithms</title>
<seriesInfo name="RFC" value="9054"/>
<author initials="J." surname="Schaad" fullname="Jim Schaad"> <author initials="J." surname="Schaad" fullname="Jim Schaad">
<organization>August Cellars</organization> <organization>August Cellars</organization>
<address> <address>
<email>ietf@augustcellars.com</email> <email>ietf@augustcellars.com</email>
</address> </address>
</author> </author>
<date/> <date year="2021" month="July"/>
<area>Security</area> <area>Security</area>
<!-- [rfced] Please insert any keywords (beyond those that appear in the title)
for use on https://www.rfc-editor.org/search. -->
<keyword>example</keyword>
<abstract> <abstract>
<t> <t>
The CBOR Object Signing and Encryption (COSE) syntax <xref target="I-D.i The CBOR Object Signing and
etf-cose-rfc8152bis-struct"/> does not define any direct methods for using hash Encryption (COSE) syntax (see RFC 9052) does not define any
algorithms. direct methods for using hash algorithms.
There are, however, circumstances where hash algorithms are used, such a There are, however, circumstances where hash algorithms are used, such
s indirect signatures where the hash of one or more contents are signed, and X.5 as indirect signatures, where the hash of one or more contents are
09 certificate or other object identification by the use of a fingerprint. signed, and an X.509 certificate or other object identification by the
This document defines a set of hash algorithms that are identified by CO use of a fingerprint.
SE Algorithm Identifiers. This document defines hash algorithms that are identified by COSE algori
thm identifiers.
</t> </t>
</abstract> </abstract>
<note removeInRFC="true">
<name>Contributing to this document</name>
<!-- RFC EDITOR - Please remove this note before publishing -->
<t>
The source for this draft is being maintained in GitHub.
Suggested changes should be submitted as pull requests at <eref target="
https://github.com/cose-wg/X509"/>
Editorial changes can be managed in GitHub, but any substantial issues n
eed to be discussed on the COSE mailing list.
</t>
</note>
</front> </front>
<middle> <middle>
<section anchor="introduction"> <section anchor="introduction">
<name>Introduction</name> <name>Introduction</name>
<t> <t>
The CBOR Object Signing and Encryption (COSE) syntax does not define any direct methods for the use of hash algorithms. The CBOR Object Signing and Encryption (COSE) syntax does not define any direct methods for the use of hash algorithms.
It also does not define a structure syntax that is used to encode a dige sted object structure along the lines of the DigestedData ASN.1 structure in <xr ef target="RFC5652"/>. It also does not define a structure syntax that is used to encode a dige sted object structure along the lines of the DigestedData ASN.1 structure in <xr ef target="RFC5652"/>.
This omission was intentional, as a structure consisting of just a diges t identifier, the content, and a digest value does not, by itself, provide any s trong security service. This omission was intentional, as a structure consisting of just a diges t identifier, the content, and a digest value does not, by itself, provide any s trong security service.
Additionally, an application is going to be better off defining this typ e of structure so that it can include any additional data that needs to be hashe d, as well as methods of obtaining the data. Additionally, an application is going to be better off defining this typ e of structure so that it can include any additional data that needs to be hashe d, as well as methods of obtaining the data.
</t> </t>
skipping to change at line 57 skipping to change at line 61
</t> </t>
<ul> <ul>
<li> <li>
Indirect signing of content, and Indirect signing of content, and
</li> </li>
<li> <li>
Object identification. Object identification.
</li> </li>
</ul> </ul>
<t> <t>
Indirect signing of content is a paradigm where the content is not direc Indirect signing of content is a paradigm where the content is not
tly signed, but instead a hash of the content is computed and that hash value, a directly signed, but instead a hash of the content is computed, and
long with an identifier for the hash algorithm, is included in the content that that hash value -- along with an identifier for the hash algorithm -- is
will be signed. included in the content that will be signed.
Doing indirect signing allows for a signature to be validated without fi Indirect signing allows for a signature to be validated without first
rst downloading all of the content associated with the signature. downloading all of the content associated with the signature.
Rather the signature can be validated on all of the hash values and poin Rather, the signature can be validated on all of the hash values and
ters to the associated contents, then those associated parts can be downloaded, pointers to the associated contents; those associated parts can then
the hash value of that part computed, and then compared to the hash value in the be downloaded, then the hash value of that part can be computed and
signed content. compared to the hash value in the signed content.
This capability can be of even greater importance in a constrained envir This capability can be of even greater importance in a constrained
onment as not all of the content signed may be needed by the device. environment, as not all of the content signed may be needed by the
An example of how this is used can be found in <xref target="I-D.ietf-su <!--[rfced] The cited document doesn't mention indirect signatures. Please
it-manifest"/>. check that this is the correct document to cite.
Original:
Indirect signing of content is a paradigm where the content is not
directly signed, but instead a hash of the content is computed and
that hash value, along with an identifier for the hash algorithm, is
included in the content that will be signed. ... An example of how this is
used can be found in [I-D.ietf-suit-manifest].
-->
device. An example of how this is used can be found in <xref
target="I-D.ietf-suit-manifest"/>.
</t> </t>
<t> <t>
The use of hashes to identify objects is something that has been very co mmon. The use of hashes to identify objects is something that has been very co mmon.
One of the primary things that has been identified by a hash function in a secure message is a certificate. One of the primary things that has been identified by a hash function in a secure message is a certificate.
Two examples of this can be found in <xref target="RFC2634"/> and the CO SE equivalents in <xref target="I-D.ietf-cose-x509"/>. Two examples of this can be found in <xref target="RFC2634"/> and the CO SE equivalents in <xref target="I-D.ietf-cose-x509"/>.
</t> </t>
<section anchor="requirements-terminology"> <section anchor="requirements-terminology">
<name>Requirements Terminology</name> <name>Requirements Terminology</name>
<t> <t>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "S The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQU
HOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in IRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
this document are to be interpreted as described in BCP 14 <xref target="RFC211 NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>
9"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
as shown here. "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" 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>
</section> </section>
<!--
<section removeInRFC="true">
<name>Open Issues</name>
<ul>
<li>
No Open Issues
</li>
</ul>
</section>
-->
</section> </section>
<section> <section>
<name>Hash Algorithm Usage</name> <name>Hash Algorithm Usage</name>
<t> <t>
As noted in the previous section, hash functions can be used for a varie As noted in the previous section, hash functions can be used for a
ty of purposes. variety of purposes.
Some of these purposes require that a hash function be cryptographically strong. Some of these purposes require that a hash function be cryptographically strong.
These include direct and indirect signatures. These include direct and indirect signatures -- that is, using the
That is, using the hash as part of the signature or using the hash as pa hash as part of the signature or using the hash as part of the body to
rt of the body to be signed. be signed.
Other uses of hash functions may not require the same level of strength. Other uses of hash functions may not require the same level of strength.
</t> </t>
<t> <t>
This document contains some hash functions that are not designed to be u sed for cryptographic operations. This document contains some hash functions that are not designed to be u sed for cryptographic operations.
An application that is using a hash function needs to carefully evaluate exactly what hash properties are needed and which hash functions are going to p rovide them. An application that is using a hash function needs to carefully evaluate exactly what hash properties are needed and which hash functions are going to p rovide them.
Applications should also make sure that the ability to change hash funct ions is part of the base design, as cryptographic advances are sure to reduce th e strength of a hash function <xref target="BCP201"/>. Applications should also make sure that the ability to change hash funct ions is part of the base design, as cryptographic advances are sure to reduce th e strength of a hash function <xref target="BCP201"/>.
</t> </t>
<t> <t>
A hash function is a map from one, normally large, bit string to a secon d, usually smaller, bit string. A hash function is a map from one, normally large, bit string to a secon d, usually smaller, bit string.
As the number of possible input values is far greater than the number of possible output values, it is inevitable that there are going to be collisions. As the number of possible input values is far greater than the number of possible output values, it is inevitable that there are going to be collisions.
The trick is to make sure that it is difficult to find two values that a re going to map to the same output value. The trick is to make sure that it is difficult to find two values that a re going to map to the same output value.
A "Collision Attack" is one where an attacker can find two different mes sages that have the same hash value. A "Collision Attack" is one where an attacker can find two different mes sages that have the same hash value.
A hash function that is susceptible to practical collision attacks, <bcp A hash function that is susceptible to practical collision attacks <bcp1
14>SHOULD NOT</bcp14> be used for a cryptographic purpose. 4>SHOULD NOT</bcp14> be used for a cryptographic purpose.
The discovery of theoretical collision attacks against a given hash func The discovery of theoretical collision attacks against a given hash
tion <bcp14>SHOULD</bcp14> trigger protocol maintainers and users to do a review function <bcp14>SHOULD</bcp14> trigger protocol maintainers and users
of the continued suitability of the algorithm if alternatives are available and to review the continued suitability of the algorithm if
migration is viable. alternatives are available and migration is viable.
The only reason why such a hash function is used is when there is absolu The only reason such a hash function is used is when there is
tely no other choice (e.g. a Hardware Security Module (HSM) that cannot be repla absolutely no other choice (e.g., a Hardware Security Module (HSM)
ced), and only after looking at the possible security issues. that cannot be replaced), and only after looking at the possible
security issues.
Cryptographic purposes would include the creation of signatures or the u se of hashes for indirect signatures. Cryptographic purposes would include the creation of signatures or the u se of hashes for indirect signatures.
These functions may still be usable for non-cryptographic purposes. These functions may still be usable for noncryptographic purposes.
</t> </t>
<t> <t>
An example of a non-cryptographic use of a hash is for filtering from a An example of a noncryptographic use of a hash is filtering from a
collection of values to find a set of possible candidates; the candidates can th collection of values to find a set of possible candidates; the
en be checked to see if they can successfully be used. candidates can then be checked to see if they can successfully be
used.
A simple example of this is the classic fingerprint of a certificate. A simple example of this is the classic fingerprint of a certificate.
If the fingerprint is used to verify that it is the correct certificate, then that usage is a cryptographic one and is subject to the warning above abou t collision attack. If the fingerprint is used to verify that it is the correct certificate, then that usage is a cryptographic one and is subject to the warning above abou t collision attack.
If, however, the fingerprint is used to sort through a collection of cer tificates to find those that might be used for the purpose of verifying a signat ure, a simple filter capability is sufficient. If, however, the fingerprint is used to sort through a collection of cer tificates to find those that might be used for the purpose of verifying a signat ure, a simple filter capability is sufficient.
In this case, one still needs to confirm that the public key validates t he signature (and the certificate is trusted), and all certificates that don't c ontain a key that validates the signature can be discarded as false positives. In this case, one still needs to confirm that the public key validates t he signature (and the certificate is trusted), and all certificates that don't c ontain a key that validates the signature can be discarded as false positives.
</t> </t>
<t> <t>
To distinguish between these two cases, a new value in the recommended c To distinguish between these two cases, a new value in the Recommended
olumn of the COSE Algorithms registry is to be added. column of the "COSE Algorithms" registry has been added.
"Filter Only" indicates that the only purpose of a hash function should "Filter Only" indicates that the only purpose of a hash function
be to filter results and it is not intended for applications which require a cry should be to filter results; it is not intended for applications that
ptographically strong algorithm. require a cryptographically strong algorithm.
</t> </t>
<section> <section>
<name> <name>
Example CBOR hash structure Example CBOR Hash Structure
</name> </name>
<t> <t>
<xref target="RFC8152"/> did not provide a default structure for holdi <xref target="RFC8152"/> did not provide a default structure for
ng a hash value not only because no separate hash algorithms were defined, but b holding a hash value both because no separate hash algorithms
ecause how the structure is setup is frequently application specific. were defined and because the way the structure is set up is frequently
application specific.
There are four fields that are often included as part of a hash struct ure: There are four fields that are often included as part of a hash struct ure:
</t> </t>
<ul> <ul>
<li> <li>
The hash algorithm identifier. The hash algorithm identifier.
</li> </li>
<li> <li>
The hash value. The hash value.
</li> </li>
<li> <li>
A pointer to the value that was hashed. A pointer to the value that was hashed.
This could be a pointer to a file, an object that can be obtained fr This could be a pointer to a file, an object that can be obtained
om the network, or a pointer to someplace in the message, or something very appl from the network, a pointer to someplace in the message, or
ication specific. something very application specific.
</li> </li>
<li> <li>
Additional data; this can be something as simple as a random value ( Additional data. This can be something as simple as a random value
i.e. salt) to make finding hash collisions slightly harder (as the payload hande (i.e., salt) to make finding hash collisions slightly harder (because
d to the application could have been selected to have a collision), or as compli the payload handed to the application could have been selected to
cated as a set of processing instructions that are used with the object that is have a collision), or as complicated as a set of processing
pointed to. instructions that is used with the object that is pointed to.
The additional data can be dealt with in a number of ways, prependin The additional data can be dealt with in a number of ways,
g or appending to the content, but it is strongly suggested that it either be a prepending or appending to the content, but it is strongly
fixed known size, or the lengths of the pieces being hashed be included. suggested that either it be a fixed known size, or the lengths of
the pieces being hashed be included.
(Encoding as a CBOR array accomplishes this requirement.) (Encoding as a CBOR array accomplishes this requirement.)
</li> </li>
</ul> </ul>
<t> <t>
An example of a structure which permits all of the above fields to exi st would look like the following. An example of a structure that permits all of the above fields to exis t would look like the following:
</t> </t>
<sourcecode type="CDDL"> <sourcecode type="cddl">
COSE_Hash_V = ( COSE_Hash_V = (
1 : int / tstr, # Algorithm identifier 1 : int / tstr, # Algorithm identifier
2 : bstr, # Hash value 2 : bstr, # Hash value
? 3 : tstr, # Location of object that was hashed ? 3 : tstr, # Location of object that was hashed
? 4 : any # object containing other details and things ? 4 : any # object containing other details and things
) )
</sourcecode> </sourcecode>
<t> <t>
Below is an alternative structure that could be used in situations whe re one is searching a group of objects for a matching hash value. Below is an alternative structure that could be used in situations whe re one is searching a group of objects for a matching hash value.
In this case, the location would not be needed and adding extra data t o the hash would be counterproductive. In this case, the location would not be needed, and adding extra data to the hash would be counterproductive.
This results in a structure that looks like this: This results in a structure that looks like this:
</t> </t>
<sourcecode type="CDDL"> <sourcecode type="cddl">
COSE_Hash_Find = [ COSE_Hash_Find = [
hashAlg : int / tstr, hashAlg : int / tstr,
hashValue : bstr hashValue : bstr
] ]
</sourcecode> </sourcecode>
</section> </section>
</section> </section>
<section> <section>
<name>Hash Algorithm Identifiers</name> <name>Hash Algorithm Identifiers</name>
<section> <section>
<name>SHA-1 Hash Algorithm</name> <name>SHA-1 Hash Algorithm</name>
<t> <t>
The SHA-1 hash algorithm <xref target="RFC3174"/> was designed by th The SHA-1 hash algorithm <xref target="RFC3174"/> was designed by
e United States National Security Agency and published in 1995. the United States National Security Agency and published in
Since that time a large amount of cryptographic analysis has been ap 1995. Since that time, a large amount of cryptographic analysis
plied to this algorithm and a successful collision attack has been created (<xre has been applied to this algorithm, and a successful collision
f target="SHA-1-collision"/>). attack has been created <xref target="SHA-1-collision"/>.
The IETF formally started discouraging the use of SHA-1 with the pub The IETF formally started discouraging the use of SHA-1 in <xref tar
lishing of <xref target="RFC6194"/>. get="RFC6194"/>.
</t> </t>
<!-- RFC Editor -
I had an original comment that the grammar of the "or where" clau
se did not match with the start of the sentence.
I re-wrote the second sentence but it is possible that I still ha
ve the same problem.
-->
<t> <t>
Despite the above, there are still times where SHA-1 needs to be use Despite these facts, there are still times where SHA-1 needs to be
d and therefore it makes sense to assign a codepoint for the use of this hash al used; therefore, it makes sense to assign a code point for the
gorithm. use of this hash algorithm.
Some of these situations are with historic HSMs where only SHA-1 is Some of these situations involve historic HSMs where only SHA-1 is
implemented; other situations are where the SHA-1 value is used for the purpose implemented; in other situations, the SHA-1 value is used
of filtering and thus the collision resistance property is not needed. for the purpose of filtering; thus, the collision-resistance
property is not needed.
</t> </t>
<t> <t>
Because of the known issues for SHA-1 and the fact that it should no longer be used, the algorithm will be registered with the recommendation of "Fi lter Only". Because of the known issues for SHA-1 and the fact that it should no longer be used, the algorithm will be registered with the recommendation of "Fi lter Only".
This provides guidance about when the algorithm is safe for use, whi le discouraging usage where it is not safe. This provides guidance about when the algorithm is safe for use, whi le discouraging usage where it is not safe.
</t> </t>
<t> <t>
The COSE capabilities for this algorithm is an empty array. The COSE capabilities for this algorithm is an empty array.
</t> </t>
<!-- [rfced] Tables 1, 2, and 3: The Capabilities column in the IANA registry <
https://www.iana.org/assignments/cose/> shows [kty] for all of the entries liste
d in these tables. However, the text in this document says:
The COSE capabilities for this algorithm is an empty array.
Please review and let us know if the document should be updated or if the IANA r
egistry needs to be updated.
In addition, please let us know if references to RFC-to-be 9053 <draft-ietf-cose
-rfc8152bis-algs> should be added to the reference column (in addition to this d
ocument) to match the IANA registry. -->
<!-- table 1 -->
<table align="center" anchor="SHA1-Algs"> <table align="center" anchor="SHA1-Algs">
<name>SHA-1 Hash Algorithm</name> <name>SHA-1 Hash Algorithm</name>
<thead> <thead>
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Value</th> <th>Value</th>
<th>Description</th> <th>Description</th>
<th>Capabilities</th> <th>Capabilities</th>
<th>Reference</th> <th>Reference</th>
<th>Recommended</th> <th>Recommended</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>SHA-1</td> <td>SHA-1</td>
<td>-14</td> <td>-14</td>
<td>SHA-1 Hash</td> <td>SHA-1 Hash</td>
<td>[]</td> <td>[]</td>
<td>[This Document]</td> <td>RFC 9054</td>
<td>Filter Only</td> <td>Filter Only</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</section> </section>
<section> <section>
<name>SHA-2 Hash Algorithms</name> <name>SHA-2 Hash Algorithms</name>
<t> <t>
The family of SHA-2 hash algorithms <xref target="FIPS-180-4"/> was de signed by the United States National Security Agency and published in 2001. The family of SHA-2 hash algorithms <xref target="FIPS-180-4"/> was de signed by the United States National Security Agency and published in 2001.
Since that time some additional algorithms have been added to the orig inal set to deal with length extension attacks and some performance issues. Since that time, some additional algorithms have been added to the ori ginal set to deal with length-extension attacks and some performance issues.
While the SHA-3 hash algorithms have been published since that time, t he SHA-2 algorithms are still broadly used. While the SHA-3 hash algorithms have been published since that time, t he SHA-2 algorithms are still broadly used.
</t> </t>
<t> <t>
There are a number of different parameters for the SHA-2 hash function s. There are a number of different parameters for the SHA-2 hash function s.
The set of hash functions which have been chosen for inclusion in this The set of hash functions that has been chosen for inclusion in
document are based on those different parameters and some of the trade-offs inv this document is based on those different parameters and some of
olved. the trade-offs involved.
</t> </t>
<ul> <ul>
<li> <li>
<t> <t>
<strong>SHA-256/64</strong> provides a truncated hash. <strong>SHA-256/64</strong> provides a truncated hash.
The length of the truncation is designed to allow for smaller tran smission size. The length of the truncation is designed to allow for smaller tran smission size.
The trade-off is that the odds that a collision will occur increas e proportionally. The trade-off is that the odds that a collision will occur increas e proportionally.
Use of this hash function needs analysis of the potential problems Use of this hash function requires analysis of the potential
with having a collision occur, or must be limited to where the function of the problems that could result from a collision, or it must be
hash is non-cryptographic. limited to where the function of the hash is noncryptographic.
</t> </t>
<t> <t>
The latter is the case for <xref target="I-D.ietf-cose-x509"/>. The latter is the case for <xref target="I-D.ietf-cose-x509"/>.
The hash value is used to select possible certificates and, if t The hash value is used to select possible certificates; if
here are multiple choices remaining then, each choice can be tested by using the there are multiple choices remaining, then each choice can be
public key. tested by using the public key.
</t> </t>
</li> </li>
<li> <li>
<strong>SHA-256</strong> is probably the most common hash function used currently. <strong>SHA-256</strong> is probably the most common hash function used currently.
SHA-256 is an efficient hash algorithm for 32-bit hardware. SHA-256 is an efficient hash algorithm for 32-bit hardware.
</li> </li>
<li> <li>
<strong>SHA-384</strong> and <strong>SHA-512</strong> hash functio ns are efficient for 64-bit hardware. <strong>SHA-384</strong> and <strong>SHA-512</strong> hash functio ns are efficient for 64-bit hardware.
</li> </li>
<li> <li>
<strong>SHA-512/256</strong> provides a hash function that runs mo re efficiently on 64-bit hardware, but offers the same security levels as SHA-25 6. <strong>SHA-512/256</strong> provides a hash function that runs mo re efficiently on 64-bit hardware but offers the same security levels as SHA-256 .
</li> </li>
</ul> </ul>
<t> <t>
The COSE capabilities array for these algorithms is empty. The COSE capabilities array for these algorithms is empty.
</t> </t>
<!-- table 2 -->
<table align="center" anchor="SHA2-Algs"> <table align="center" anchor="SHA2-Algs">
<name>SHA-2 Hash Algorithms</name> <name>SHA-2 Hash Algorithms</name>
<thead> <thead>
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Value</th> <th>Value</th>
<th>Description</th> <th>Description</th>
<th>Capabilities</th> <th>Capabilities</th>
<th>Reference</th> <th>Reference</th>
<th>Recommended</th> <th>Recommended</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>SHA-256/64</td> <td>SHA-256/64</td>
<td>-15</td> <td>-15</td>
<td>SHA-2 256-bit Hash truncated to 64-bits</td> <td>SHA-2 256-bit Hash truncated to 64-bits</td>
<td>[]</td> <td>[]</td>
<td>[This Document]</td> <td>RFC 9054</td>
<td>Filter Only</td> <td>Filter Only</td>
</tr> </tr>
<tr> <tr>
<td>SHA-256</td> <td>SHA-256</td>
<td>-16</td> <td>-16</td>
<td>SHA-2 256-bit Hash</td> <td>SHA-2 256-bit Hash</td>
<td>[]</td> <td>[]</td>
<td>[This Document]</td> <td>RFC 9054</td>
<td>Yes</td> <td>Yes</td>
</tr> </tr>
<tr> <tr>
<td>SHA-384</td> <td>SHA-384</td>
<td>-43</td> <td>-43</td>
<td>SHA-2 384-bit Hash</td> <td>SHA-2 384-bit Hash</td>
<td>[]</td> <td>[]</td>
<td>[This Document]</td> <td>RFC 9054</td>
<td>Yes</td> <td>Yes</td>
</tr> </tr>
<tr> <tr>
<td>SHA-512</td> <td>SHA-512</td>
<td>-44</td> <td>-44</td>
<td>SHA-2 512-bit Hash</td> <td>SHA-2 512-bit Hash</td>
<td>[]</td> <td>[]</td>
<td>[This Document]</td> <td>RFC 9054</td>
<td>Yes</td> <td>Yes</td>
</tr> </tr>
<tr> <tr>
<td>SHA-512/256</td> <td>SHA-512/256</td>
<td>-17</td> <td>-17</td>
<td>SHA-2 512-bit Hash truncated to 256-bits</td> <td>SHA-2 512-bit Hash truncated to 256-bits</td>
<td>[]</td> <td>[]</td>
<td>[This Document]</td> <td>RFC 9054</td>
<td>Yes</td> <td>Yes</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</section> </section>
<section> <section>
<name>SHAKE Algorithms</name> <name>SHAKE Algorithms</name>
<t> <t>
The family of SHA-3 hash algorithms <xref target="FIPS-202"/> was the result of a competition run by NIST. The family of SHA-3 hash algorithms <xref target="FIPS-202"/> was the result of a competition run by NIST.
The pair of algorithms known as SHAKE-128 and SHAKE-256 are the instan ces of SHA-3 that are currently being standardized in the IETF. The pair of algorithms known as SHAKE-128 and SHAKE-256 are the instan ces of SHA-3 that are currently being standardized in the IETF.
<!-- Check with Roman - maybe delete -->
This is the reason for including these algorithms in this document. This is the reason for including these algorithms in this document.
</t> </t>
<t> <t>
The SHA-3 hash algorithms have a significantly different structure tha n the SHA-2 hash algorithms. The SHA-3 hash algorithms have a significantly different structure tha n the SHA-2 hash algorithms.
</t> </t>
<t> <t>
Unlike the SHA-2 hash functions, no algorithm identifier is created fo r shorter lengths. Unlike the SHA-2 hash functions, no algorithm identifier is created fo r shorter lengths.
The length of the hash value stored is 256-bits for SHAKE-128 and 512- The length of the hash value stored is 256 bits for SHAKE-128 and
bits for SHAKE-256. 512 bits for SHAKE-256.
</t> </t>
<t> <t>
The COSE capabilities array for these algorithms is empty. The COSE capabilities array for these algorithms is empty.
</t> </t>
<!-- table 3 -->
<table align="center" anchor="SHAKE-Algs"> <table align="center" anchor="SHAKE-Algs">
<name>SHAKE Hash Functions</name> <name>SHAKE Hash Functions</name>
<thead> <thead>
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Value</th> <th>Value</th>
<th>Description</th> <th>Description</th>
<th>Capabilities</th> <th>Capabilities</th>
<th>Reference</th> <th>Reference</th>
<th>Recommended</th> <th>Recommended</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>SHAKE128</td> <td>SHAKE128</td>
<td>-18</td> <td>-18</td>
<td>SHAKE-128 256-bit Hash Value</td> <td>SHAKE-128 256-bit Hash Value</td>
<td>[]</td> <td>[]</td>
<td>[This Document]</td> <td>RFC 9054</td>
<td>Yes</td> <td>Yes</td>
</tr> </tr>
<tr> <tr>
<td>SHAKE256</td> <td>SHAKE256</td>
<td>-45</td> <td>-45</td>
<td>SHAKE-256 512-bit Hash Value</td> <td>SHAKE-256 512-bit Hash Value</td>
<td>[]</td> <td>[]</td>
<td>[This Document]</td> <td>RFC 9054</td>
<td>Yes</td> <td>Yes</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</section> </section>
</section> </section>
<section anchor="iana-considerations"> <section anchor="iana-considerations">
<name>IANA Considerations</name> <name>IANA Considerations</name>
<!-- RFC Editor
I think that this paragraph can be removed before publishing.
-->
<t>
The IANA actions in <xref target="I-D.ietf-cose-rfc8152bis-struct"/> and
<xref target="I-D.ietf-cose-rfc8152bis-algs"/> need to be executed before the a
ctions in this document.
Where early allocation of codepoints has been made, these should be pres
erved.
</t>
<section anchor="cose-algorithm-registry"> <section anchor="cose-algorithm-registry">
<name>COSE Algorithm Registry</name> <name>COSE Algorithm Registry</name>
<t> <t>
IANA is requested to register the following algorithms in the "COSE Al gorithms" registry. IANA has registered the following algorithms in the <eref target="http s://www.iana.org/assignments/cose/">"COSE Algorithms" registry</eref>.
</t> </t>
<ul> <ul>
<li> <li>
The SHA-1 hash function found in <xref target="SHA1-Algs"/>. The SHA-1 hash function found in <xref target="SHA1-Algs"/>.
</li> </li>
<li> <li>
The set of SHA-2 hash functions found in <xref target="SHA2-Algs"/>. The set of SHA-2 hash functions found in <xref target="SHA2-Algs"/>.
</li> </li>
<li> <li>
The set of SHAKE hash functions found in <xref target="SHAKE-Algs"/> . The set of SHAKE hash functions found in <xref target="SHAKE-Algs"/> .
</li> </li>
</ul> </ul>
<!-- IANA <!-- IANA
The following paragraph is retained for historic reasons only. The following paragraph is retained for historic reasons only.
--> -->
<t> <t>
Many of the hash values produced are relatively long and as such the u Many of the hash values produced are relatively long; as such,
se of a two byte algorithm identifier seems reasonable. use of a two-byte algorithm identifier seems reasonable.
SHA-1 is tagged as 'Filter Only' and thus a longer algorithm identifie SHA-1 is tagged as "Filter Only", so a longer algorithm identifier is
r is appropriate even though it is a shorter hash value. appropriate even though it is a shorter hash value.
</t> </t>
<t> <t>
IANA is requested to add the value of 'Filter Only' to the set of lega IANA has added the value of "Filter Only" to the set of
l values for the 'Recommended' column. legal values for the Recommended column.
This value is only to be used for hash functions and indicates that it This value is only to be used for hash functions and indicates that
is not to be used for purposes which require collision resistance. it is not to be used for purposes that require collision
IANA is requested to add this document to the reference section for th resistance. As a result of this addition, IANA has added this document
is table due to this addition. as a reference for the "COSE Algorithms" registry.
</t> </t>
</section> </section>
</section> </section>
<section anchor="security-considerations"> <section anchor="security-considerations">
<name>Security Considerations</name> <name>Security Considerations</name>
<t> <t>
Protocols need to perform a careful analysis of the properties of a ha sh function that are needed and how they map onto the possible attacks. Protocols need to perform a careful analysis of the properties of a ha sh function that are needed and how they map onto the possible attacks.
In particular, one needs to distinguish between those uses that need t he cryptographic properties, such as collision resistance, and properties that c orrespond to possible object identification. In particular, one needs to distinguish between those uses that need t he cryptographic properties, such as collision resistance, and properties that c orrespond to possible object identification.
The different attacks correspond to who or what is being protected: is it the originator that is the attacker or a third party? The different attacks correspond to who or what is being protected: is it the originator that is the attacker or a third party?
This is the difference between collision resistance and second pre-ima ge resistance. This is the difference between collision resistance and second pre-ima ge resistance.
As a general rule, longer hash values are "better" than short ones, bu t trade-offs of transmission size, timeliness, and security all need to be inclu ded as part of this analysis. As a general rule, longer hash values are "better" than short ones, bu t trade-offs of transmission size, timeliness, and security all need to be inclu ded as part of this analysis.
In many cases the value being hashed is a public value and, as such, p re-image resistance is not part of this analysis. In many cases, the value being hashed is a public value and, as such, pre-image resistance is not part of this analysis.
</t> </t>
<t> <t>
Algorithm agility needs to be considered a requirement for any use of hash functions <xref target="BCP201"/>. Algorithm agility needs to be considered a requirement for any use of hash functions <xref target="BCP201"/>.
As with any cryptographic function, hash functions are under constant As with any cryptographic function, hash functions are under
attack and the cryptographic strength of hash algorithms will be reduced over ti constant attack, and the cryptographic strength of hash algorithms
me. will be reduced over time.
</t> </t>
</section> </section>
</middle> </middle>
<back xmlns:xi="http://www.w3.org/2001/XInclude" xml:base="http://xml2rfc.ietf <back>
.org/public/rfc/">
<displayreference target="RFC2634" to="ESS"/> <displayreference target="RFC2634" to="ESS"/>
<displayreference target="RFC5652" to="CMS"/> <displayreference target="RFC5652" to="CMS"/>
<displayreference target="RFC8152" to="COSE"/> <displayreference target="RFC8152" to="COSE"/>
<displayreference target="I-D.ietf-cose-x509" to="COSE-x509"/>
<displayreference target="I-D.ietf-suit-manifest" to="SUIT-MANIFEST"/>
<references title='Normative References'> <references title='Normative References'>
<xi:include href="bibxml/reference.RFC.2119.xml" />
<xi:include href="bibxml/reference.RFC.8174.xml" /> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.
<xi:include href="bibxml3/reference.I-D.ietf-cose-rfc8152bis-struct.xml" / xml"/>
> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.
xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3174.
xml"/>
<!--[rfced] The following note appeared in the XML file:
RFC Editor
I think that this paragraph can be removed before publishing.
With the text removed, both [I-D.ietf-cose-rfc8152bis-algs] (RFC 9053) and [I-D.
ietf-cose-rfc8152bis-struct] (RFC 9052) are no longer cited.
Please let us know where they should be cited or if the references should be rem
oved.
-->
<!-- [I-D.ietf-cose-rfc8152bis-struct] RFC 9052 -->
<reference anchor='RFC9052' target="https://www.rfc-editor.org/info/rfc9052">
<front>
<title>CBOR Object Signing and Encryption (COSE): Structures and Process</title>
<author initials='J' surname='Schaad' fullname='Jim Schaad'>
<organization />
</author>
<date month='July' year='2021' />
</front>
<seriesInfo name="STD" value="96"/>
<seriesInfo name="RFC" value="9052"/>
<seriesInfo name="DOI" value="10.17487/RFC9052"/>
</reference>
<reference anchor="FIPS-180-4"> <reference anchor="FIPS-180-4">
<front> <front>
<title>Secure Hash Standard</title> <title>Secure Hash Standard</title>
<author> <author>
<organization>National Institute of Standards and Technology</organi zation> <organization>NIST</organization>
</author> </author>
<date month="August" year="2015"/> <date month="August" year="2015"/>
</front> </front>
<seriesInfo name="FIPS" value="PUB 180-4"/> <seriesInfo name="FIPS PUB" value="180-4"/>
<seriesInfo name="DOI" value="10.6028/NIST.FIPS.180-4"/>
</reference> </reference>
<reference anchor="FIPS-202"> <reference anchor="FIPS-202">
<front> <front>
<title>SHA-3 Standard: Permutation-Based Hash and Extendable-Output Fu <title>SHA-3 Standard: Permutation-Based Hash and Extendable-Output
nctions</title> Functions</title>
<author> <author initials="M.J." surname="Dworkin">
<organization>National Institute of Standards and Technology</organi zation> <organization>National Institute of Standards and Technology</organi zation>
</author> </author>
<date month="August" year="2015"/> <date month="August" year="2015"/>
</front> </front>
<seriesInfo name="FIPS" value="PUB 202"/> <seriesInfo name="FIPS PUB" value="202"/>
<seriesInfo name="DOI" value="10.6028/NIST.FIPS.202"/>
</reference> </reference>
<!--
<?rfc include="bibxml/reference.RFC.5280.xml" />
-->
<xi:include href="bibxml/reference.RFC.3174.xml" />
</references> </references>
<references title='Informative References'> <references title='Informative References'>
<xi:include href="bibxml/reference.RFC.5652.xml"/>
<xi:include href="bibxml/reference.RFC.2634.xml"/> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5652.
<xi:include href="bibxml3/reference.I-D.ietf-cose-x509.xml"/> xml"/>
<xi:include href="bibxml/reference.RFC.6194.xml"/> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2634.
<xi:include href="bibxml3/reference.I-D.ietf-cose-rfc8152bis-algs.xml"/> xml"/>
<xi:include href="bibxml3/reference.I-D.ietf-suit-manifest.xml"/> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6194.
xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8152.
xml"/>
<!-- [I-D.ietf-cose-x509] Approved-announcement to be sent::Revised I-D Needed
-->
<xi:include href="https://datatracker.ietf.org/doc/bibxml3/reference.I-D.ietf-co
se-x509.xml"/>
<!-- [I-D.ietf-cose-rfc8152bis-algs] RFC 9053 -->
<reference anchor="RFC9053" target="https://www.rfc-editor.org/info/rfc9053">
<front>
<title>CBOR Object Signing and Encryption (COSE): Initial Algorithms</tit
le>
<author initials="J." surname="Schaad" fullname="Jim Schaad">
<organization />
</author>
<date month="July" year="2021" />
</front>
<seriesInfo name="RFC" value="9053" />
<seriesInfo name="DOI" value="10.17487/RFC9053"/>
</reference>
<!-- [I-D.ietf-suit-manifest] IESG state I-D Exists -->
<xi:include
href="https://datatracker.ietf.org/doc/bibxml3/reference.I-D.ietf-suit-manif
est.xml"/>
<!-- <!--
<xi:include href="bibxml/reference.RFC.2585.xml"/> <xi:include href="bibxml/reference.RFC.2585.xml"/>
<xi:include href="bibxml/reference.RFC.5246.xml"/> <xi:include href="bibxml/reference.RFC.5246.xml"/>
<xi:include href="bibxml/reference.RFC.7468.xml"/> <xi:include href="bibxml/reference.RFC.7468.xml"/>
<xi:include href="bibxml/reference.RFC.8152.xml"/> <xi:include href="bibxml/reference.RFC.8152.xml"/>
<xi:include href="bibxml/reference.RFC.8392.xml"/> <xi:include href="bibxml/reference.RFC.8392.xml"/>
<xi:include href="bibxml/reference.I-D.ietf-lamps-rfc5751-bis.xml"/> <xi:include href="bibxml/reference.I-D.ietf-lamps-rfc5751-bis.xml"/>
<xi:include href="bibxml/reference.I-D.ietf-cbor-cddl.xml"/> <xi:include href="bibxml/reference.I-D.ietf-cbor-cddl.xml"/>
<xi:include href="bibxml/reference.I-D.selander-ace-cose-ecdhe.xml"/> <xi:include href="bibxml/reference.I-D.selander-ace-cose-ecdhe.xml"/>
--> -->
<!-- <xi:include href="bibxml/reference.BCP.0201.xml"/> --> <!-- <xi:include href="bibxml/reference.BCP.0201.xml"/> -->
<referencegroup anchor="BCP201" target="https://www.rfc-editor.org/info/bcp201">
<!-- reference.RFC.7696.xml --> <reference anchor="BCP201" target="https://www.rfc-editor.org/info/bcp201">
<reference anchor="RFC7696" target="https://www.rfc-editor.org/info/rfc7696">
<front> <front>
<title> <title>Guidelines for Cryptographic Algorithm Agility and Selecting Manda
Guidelines for Cryptographic Algorithm Agility and Selecting Mandatory-to-Implem tory-to-Implement
ent Algorithms Algorithms</title>
</title>
<author initials="R." surname="Housley" fullname="R. Housley"> <author initials="R." surname="Housley" fullname="Russ Housley">
<organization/> <organization />
</author> </author>
<date year="2015" month="November"/>
<abstract> <date month="November" year="2015" />
<t> </front>
Many IETF protocols use cryptographic algorithms to provide confidentiality, int <seriesInfo name="BCP" value="201" />
egrity, authentication, or digital signature. Communicating peers must support a <seriesInfo name="RFC" value="7696"/>
common set of cryptographic algorithms for these mechanisms to work properly. T </reference>
his memo provides guidelines to ensure that protocols have the ability to migrat
e from one mandatory-to-implement algorithm suite to another over time.
</t>
</abstract>
</front>
<seriesInfo name="BCP" value="201"/>
<seriesInfo name="RFC" value="7696"/>
<seriesInfo name="DOI" value="10.17487/RFC7696"/>
</reference>
</referencegroup>
<reference anchor="SHA-1-collision" target="https://shattered.io/static/shattere d.pdf"> <reference anchor="SHA-1-collision" target="https://shattered.io/static/shattere d.pdf">
<front> <front>
<title>The first collision for full SHA-1</title> <title>The first collision for full SHA-1</title>
<author initials="M." surname="Stevens"/> <author initials="M." surname="Stevens"/>
<author initials="E." surname="Bursztein"/> <author initials="E." surname="Bursztein"/>
<author initials="P." surname="Karpman"/> <author initials="P." surname="Karpman"/>
<author initials="A." surname="Albertini"/> <author initials="A." surname="Albertini"/>
<author initials="Y." surname="Markov"/> <author initials="Y." surname="Markov"/>
<date month="Feb" year="2017"/> <date month="Feb" year="2017"/>
</front> </front>
</reference> </reference>
<xi:include href="bibxml/reference.RFC.8152.xml"/>
</references> </references>
</back> </back>
</rfc> </rfc>
 End of changes. 63 change blocks. 
217 lines changed or deleted 275 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/

mirror server hosted at Truenetwork, Russian Federation.