%ents; ]>
Cryptographic Hash Function Recommendations for XMPP This document provides recommendations for the use of cryptographic hash functions in XMPP protocol extensions. &LEGALNOTICE; 0414 Experimental Informational Standards Council hashrecs &jonaswielicki; 0.2.0 2019-04-28 jsc Fix references to hashes namespace. 0.1.0 2019-02-04 XEP Editor (jsc) Accepted by vote of Council on 2019-01-16. 0.0.1 2019-01-13 psa

Split from XEP-0300.

Various XMPP extensions make use of cryptographic hash functions, but they do so in different ways (e.g., some define XML elements and some define XML attributes) and often mandate support for different algorithms.

This specification provides recommendations from the XMPP council as to which cryptographic hash functions should and should not be used by XMPP entities.

This recommendation does not specify the hash algorithms themselves; it merely refers to existing algorithms.

&xep0300; (which historically has contained the recommendations in this specification) describes a common wire-format to be used to transport hash function values in XMPP.

This recommendation should meet the following goals:

This specification is not meant to override recommendations or requirements laid out by other specifications. Other specifications can however defer their recommendations or requirements to this specification.

A specification which makes use of cryptographic hash functions (such as &xep0234; or &xep0390;) can refer to this specification instead of making recommendations on hash functions on their own.

If a protocol specification defers its decision on hash functions to this document, it should support transporting multiple hashes at the same time (preferably using &xep0300;).

By default, when an entity receives multiple hash function values for the same input, it SHOULD either (a) use all hash values or (b) the hash value of the algroithm with the most security confidence for verification purposes.

The MD2 algorithm is not used in any XMPP protocols and has been deprecated by the IETF (see &rfc6149;).

The MD4 algorithm is not used in any XMPP protocols and has been deprecated by the IETF (see &rfc6150;).

The MD5 algorithm was commonly used in earlier generations of Internet technologies. As explained in &rfc6151;, the MD5 algorithm "is no longer acceptable where collision resistance is required" (such as in digital signatures) and "new protocol designs should not employ HMAC-MD5" either.

The currently known best attack against the pre-image resistance property of the MD5 algorithm is slightly better than the generic attack and was released 2009 Yu Sasaki and Kazumaro Aoki, "Finding preimages in full MD5 faster than exhaustive search" <https://doi.org/10.1007/978-3-642-01001-9_8>..

The primary use of MD5 in XMPP protocols is &xep0096;, which will be obsoleted by &xep0234;.

The SHA-0 algorithm was developed by the U.S. National Security Agency and first published in 1993. It was never widely deployed and is not used in any XMPP protocols.

The SHA-1 algorithm was developed by the U.S. National Security Agency and first published in 1995 to fix problems with SHA-0. The SHA-1 algorithm is currently the most widely-deployed hash function. As described in &rfc4270; in 2005, attacks have been found against the collision resistance property of SHA-1. &rfc6194; notes that as of 2011 no published results indicate improvement upon those attacks. In addition, RFC 6194 notes that "[t]here are no known pre-image or second pre-image attacks that are specific to the full round SHA-1 algorithm". Furthermore, there is no indication that attacks on SHA-1 can be extended to HMAC-SHA-1. Nevertheless, the U.S. National Institute of Standards and Technology (NIST) has recommended that SHA-1 not be used for generating digital signatures after December 31, 2010.

In fall 2015 the SHA-1 collision cost has been estimated between 75K$ to 120K$ The SHAppening: freestart collisions for SHA-1 <https://sites.google.com/site/itstheshappening/>..

The SHA-1 algorithm is used in a number of XMPP protocols. See Analysis of Existing XMPP Extensions for details.

The SHA-2 family of algorithms (SHA-224, SHA-256, SHA-384, and SHA-512) was developed by the U.S. National Security Agency and first published in 2001. Because SHA-2 is somewhat similar to SHA-1, it is thought that the security flaws with SHA-1 described above could be extended to SHA-2 (although no such attacks have yet been found on the full-round SHA-2 algorithms).

The SHA-3 family of algorithms (SHA3-224, SHA3-256, SHA3-384, and SHA3-512) is based on the Keccak algortihm developed by Guido Bertoni, Joan Daemen, Michaƫl Peeters, and Gilles Van Assche, and was pubished by NIST on August 5, 2015 in FIPS PUB 202: SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions FIPS PUB 202: SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions <http://dx.doi.org/10.6028/NIST.FIPS.202>. after a public hash function competition.

The BLAKE2 family of algorithms was designed by Jean-Philippe Aumasson, Samuel Neves, Zooko Wilcox-O'Hearn, and Christian Winnerlein. It is described in &rfc7693; and is designed to be highly secure and run well on both software and hardware platforms.

The current recommendations are as follows:

Algorithm Digest Size Support
MD2 128 bits MUST NOT
MD4 128 bits MUST NOT
MD5 128 bit MUST NOT
SHA-1 160 bits SHOULD NOT
SHA-256 256 bits MUST
SHA-512 512 bits SHOULD
SHA3-256 256 bits MUST
SHA3-512 512 bits SHOULD
BLAKE2b256 256 bits MUST
BLAKE2b512 512 bits SHOULD

These recommendations ought to be reviewed yearly by the &COUNCIL;.

Thanks to the authors and involved people in &xep0300;; This specification is a mostly verbatim excerpt of a &xep0300; version 0.5.3.