MessageDigest Algorithms

Links

Design and Analysis

Interoperability

One of the attributes of message digest algorithms that sometimes causes interoperability problems or difficulty in implementation, is that by convention most message digests can be applied to either a bit string, or a byte string. (Remember that byte is synonymous with "octet" in this specification.) The specification will usually concentrate on one of these input representations, and sometimes does not make it clear how to apply the algorithm to the other. Here we use the following terminology to describe how bit and byte ordering is handled by each message digest: Example: if the bit string 1110 is hashed with a big-bit-endian, little-byte-endian, left-justified algorithm, then this becomes the octet string [11101000, 00000000, 00000000, 00000000], which corresponds to the word 00000000000000000000000011101000.

For messages that are specified as octet strings (or a multiple of 8 bits), a left-justified algorithm that employs the "one and zeroes" padding method can be implemented by appending the byte value 0x80 to the message. In the same circumstances a right-justified algorithm can be implemented by appending the byte value 0x01 to the message.

Note that the bit-endianness and byte-endianness of an algorithm are not necessarily the same (for example MD4 and MD5 are big-bit-endian, but little-byte-endian). The most consistent choice for left or right justification is that a big-bit-endian algorithm be left-justified, and a little-bit-endian algorithm be right-justified; all of the SCAN algorithms that have been defined so far follow this rule.

Block MessageDigests

Some MessageDigest algorithms can be classified as "Block MessageDigests". These algorithms have the following properties: Block MessageDigest implementations SHOULD provide additional methods to get the state size, the block size, the maximum size of the final block, and to perform the compression, padding, and finalisation functions. This is necessary because some constructions that use MessageDigests, depend on being able to access these parameters and functions independently (rather than treating the digest as a black box).

The representation of the state always uses the same byte order convention as the rest of the algorithm, and chaining variables are represented in the same order as they are numbered or lettered.

Some algorithms, such as GOST-Hash or Panama, are not classified as Block MessageDigests even though it would technically be possible to describe them in the form given above, because the representation of the state is complicated or has not been standardised.


BRS-H1(cipher)...BRS-H20(cipher) 20 Block MessageDigest Constructions
Description:
The paper by Black, Rogaway, and Shrimpton cited below specifies 20 message digest constructions based on a block cipher, which it refers to as H1 to H20. BRS-H1 to BRS-H20 are based on these contructions, but with concrete choices for the initial value h0 and the constant value v where applicable, and using Merkle-Damgård-strengthening as specified below.

Let B be the cipher block size in bytes. The initial value h0 is the first block of the binary expansion of the fractional part of pi, i.e. h0 = I2OSPB(floor((pi - 3) × 256B)). The first 32 bytes of this are:

<243F6A8885A308D313198A2E03707344
 A4093822299F31D0082EFA98EC4E6C89>

(The BRS paper suggests a zero block for h0, but this may have unfortunate consequences for the constructions that use h0 as a key, if the zero block is a weak key for the cipher.)

The fixed block v used by BRS-H{13,15,16,19} is the first block of the binary expansion of the fractional part of e (the base of natural logarithms), i.e. v = I2OSPB(floor((e - 2) × 256B)). The first 32 bytes of this are [[TBD]].

The MD-strengthening is done in the same way as SHA-1. That is:

The block size, B bytes, MUST also be a valid key size for the cipher. (For BRS-H5 and BRS-H15, this constraint is not absolutely required by the definitions of the constructions, but the general case of BRS-H{5,15} where the message can be processed in blocks corresponding to any valid key size is not currently included in SCAN.)

Aliases:
"Davies-Meyer" is an alias for BRS-H5.
References:
Parameters:
Digest length:
B bytes.
Block size:
B bytes.
Max. final block size:
((-9) mod B) bytes.
State size:
B bytes.
Missing information:
Test vectors; first 32 bytes of expansion of e.
Comments:
BRS-H1...BRS-H20 are big-bit-endian and left-justified.
Security comments:


GOST-Hash MessageDigest
Alias:
"GOST-R-34.11-94"
Published:
1994
References:
Digest length:
32 bytes.
Comments:
Security comments:


HAS-V[(digestLength)] Block MessageDigest
Designers:
Nan Kyoung Park, Joon Ho Hwang, Pil Joong Lee
Published:
2000
References:
Parameters:
Digest length:
As specified by the digestLength parameter (in bytes).
Block size:
128 bytes.
Max. final block size:
118 bytes.
State size:
40 bytes.
Missing information:
Test vectors for tailored output (digestLength < 40).
Comment:
HAS-V is big-bit-endian, little-byte-endian, and left-justified. (Note the opposite bit and byte order.)


HAVAL[(digestLength[,passes])] Block MessageDigest
Designers:
Yuliang Zheng, Josef Pieprzyk, Jennifer Seberry
Published:
1992
Alias:
"OpenPGP.Digest.7" for HAVAL(20,5)
References:
Parameters:
Digest length:
As specified by the digestLength parameter (in bytes).
Block size:
128 bytes.
Max. final block size:
117 bytes.
State size:
32 bytes.
Comments:
Security comment:
5 passes are recommended, to protect against the attacks described in the paper "Cryptanalysis of Reduced Version of HAVAL".


MD2 Block MessageDigest
Designer:
Ron Rivest
Alias:
"OpenPGP.Digest.5"
Object Identifier:
1.2.840.113549.2.2
References:
Digest length:
16 bytes.
Block size:
16 bytes.
Max. final block size:
15 bytes.
State size:
32 bytes (current value of 16-byte checksum, followed by feedback registers).
Comments:
Security comment:
N. Rogier and P. Chauvaud have found a method of generating collisions for MD2's compression function. Quoting from RSA Laboratories Security Bulletin #4:
[C]aution requires that MD2 be no longer recommended for new applications where collision-resistance is required. Questions about the continuing suitability of MD2 for existing applications remain open. [... O]ur recommendation would be to upgrade applications away from MD2 whenever it is practical.


MD4 Block MessageDigest
Designer:
Ron Rivest
Published:
1990
Object Identifier:
1.2.840.113549.2.4
References:
Digest length:
16 bytes.
Block size:
64 bytes.
Max. final block size:
55 bytes.
State size:
16 bytes.
Comment:
MD4 is big-bit-endian, little-byte-endian, and left-justified. (Note the opposite bit and byte order.)
Security comment:
Bert den Boer, Antoon Bosselaers and Hans Dobbertin have found a method of generating collisions for the full MD4 algorithm. Quoting from RSA Laboratories Security Bulletin #4:
[I]t has been shown that collisions for MD4 can be found in about a minute on a typical PC. [...] MD4 [...] should not be used.


MD5 Block MessageDigest
Designer:
Ron Rivest
Alias:
"OpenPGP.Digest.1"
Object Identifier:
1.2.840.113549.2.5
References:
Digest length:
16 bytes.
Block size:
64 bytes.
Max. final block size:
55 bytes.
State size:
16 bytes.
Comments:
Security comment:
Hans Dobbertin has found a method of generating collisions for MD5's compression function. Quoting from RSA Laboratories Security Bulletin #4:
Given the surprising speed with which techniques on MD4 were extended to MD5 we feel that it is only prudent to draw a cautious conclusion and to expect that collisions for the entire hash function might soon be found.

In addition, the 128-bit output is arguably not long enough to make generating collisions using a birthday attack infeasible.


Panama MessageDigest
Designers:
Joan Daemen, Craig Clapp
Published:
1998
References:
Digest length:
32 bytes.
Comments:


RIPEMD-128 Block MessageDigest
Designers:
Hans Dobbertin, Antoon Bosselaers, Bart Preneel
Published:
April 1996
Alias:
"RIPEMD128"
Object Identifier:
1.3.36.3.2.2
References:
Digest length:
16 bytes.
Block size:
64 bytes.
Max. final block size:
55 bytes.
State size:
16 bytes.
Comment:
RIPEMD-128 is big-bit-endian, little-byte-endian, and left-justified. (Note the opposite bit and byte order.) SCAN 1.0.16 incorrectly stated "little-bit-endian, little-byte-endian, and right-justified".
Security comment:
The 128-bit output is arguably not long enough to make generating collisions using a birthday attack infeasible.


RIPEMD-160 Block MessageDigest
Designers:
Hans Dobbertin, Antoon Bosselaers, Bart Preneel
Published:
April 1996
Aliases:
"RIPEMD160", "OpenPGP.Digest.3"
Object Identifier:
1.3.36.3.2.1
References:
Digest length:
20 bytes.
Block size:
64 bytes.
Max. final block size:
55 bytes.
State size:
20 bytes.
Comment:
RIPEMD-160 is big-bit-endian, little-byte-endian, and left-justified. (Note the opposite bit and byte order.) SCAN 1.0.16 incorrectly stated "little-bit-endian, little-byte-endian, and right-justified".


RIPEMD-256 Block MessageDigest
Designers:
Hans Dobbertin, Antoon Bosselaers, Bart Preneel
Published:
April 1996
Alias:
"RIPEMD256"
Description:
A double-width variant of RIPEMD-128.
References:
Digest length:
32 bytes.
Block size:
64 bytes.
Max. final block size:
55 bytes.
State size:
16 bytes.
Comment:
RIPEMD-256 is big-bit-endian, little-byte-endian, and left-justified. (Note the opposite bit and byte order.) SCAN 1.0.16 incorrectly stated "little-bit-endian, little-byte-endian, and right-justified".
Security comment:
This message digest is not claimed to provide a security level higher than RIPEMD-128. Since the 128-bit internal state is arguably not long enough to make generating collisions using a birthday attack infeasible, RIPEMD-256 should also not be used for applications where collision-resistance is required. Consider using SHA-256 instead.


RIPEMD-320 Block MessageDigest
Designers:
Hans Dobbertin, Antoon Bosselaers, Bart Preneel
Published:
April 1996
Alias:
"RIPEMD320"
Description:
A double-width variant of RIPEMD-160.
References:
Digest length:
40 bytes.
Block size:
64 bytes.
Max. final block size:
55 bytes.
State size:
20 bytes.
Comment:
RIPEMD-320 is big-bit-endian, little-byte-endian, and left-justified. (Note the opposite bit and byte order.) SCAN 1.0.16 incorrectly stated "little-bit-endian, little-byte-endian, and right-justified".
Security comment:
This message digest is not claimed to provide a security level higher than RIPEMD-160. Consider using SHA-384, SHA-512 or Whirlpool instead.


SHA-0 Block MessageDigest
Designers:
U.S. National Security Agency
Published:
January 1992
Object Identifier:
1.3.14.3.2.13
References:
Digest length:
20 bytes.
Block size:
64 bytes.
Max. final block size:
55 bytes.
State size:
20 bytes.
Comment:
SHA-0 is big-bit-endian, big-byte-endian, and left-justified.
Security comment:
This is the original version of the Secure Hash Algorithm, and has been superceded by SHA-1. Although the motivation for the change leading to SHA-1 was not made public by the NSA, the paper by Chabaud and Joux cited above provides evidence that this change improved security.


SHA-1 Block MessageDigest
Designers:
U.S. National Security Agency
Published:
April 1995
Aliases:
"SHA", "SHA1", "OpenPGP.Digest.2", "http://www.w3.org/2000/02/xmldsig#sha1"
Object Identifier:
1.3.14.3.2.26
References:
Digest length:
20 bytes.
Block size:
64 bytes.
Max. final block size:
55 bytes.
State size:
20 bytes.
Comment:
SHA-1 is big-bit-endian, big-byte-endian, and left-justified.


SHA-256 Block MessageDigest
Designers:
U.S. National Security Agency
Published:
October? 2000
Object Identifier:
2.16.840.1.101.3.4.2.1
References:
Digest length:
32 bytes.
Block size:
64 bytes.
Max. final block size:
55 bytes.
State size:
32 bytes.
Comments:


SHA-384 Block MessageDigest
Designers:
U.S. National Security Agency
Published:
October? 2000
Object Identifier:
2.16.840.1.101.3.4.2.2
References:
[see references for SHA-256]
Digest length:
48 bytes.
Block size:
128 bytes.
Max. final block size:
111 bytes.
State size:
64 bytes.
Comments:
[see comments for SHA-256]


SHA-512 Block MessageDigest
Designers:
U.S. National Security Agency
Published:
October? 2000
Object Identifier:
2.16.840.1.101.3.4.2.3
References:
[see references for SHA-256]
Digest length:
64 bytes.
Block size:
128 bytes.
Max. final block size:
111 bytes.
State size:
64 bytes.
Comment:
[see comments for SHA-256]


Snefru-2[(digestLength[,passes])] Block MessageDigest
Designer:
Ralph Merkle
Published:
1990?
Description:
This is version 2.x of Snefru. The version numbers 2.0, 2.1, 2.2, 2.3 and 2.5a for the reference implementation all refer to the same algorithm (although with a different number of default passes). Therefore, it is only necessary to specify the major version number (2) in the algorithm name.

The difference between Snefru-1 and Snefru-2 is that Snefru-2 uses a different set of initial S-boxes, derived from the Rand Corporation's list of random digits.

References:
Parameters:
Digest length:
As specified by the digestLength parameter (in bytes).
Block size:
For digestLength = 16: 48 bytes.
For digestLength = 32: 32 bytes.
Max. final block size:
For digestLength = 16: 40 bytes.
For digestLength = 32: 24 bytes.
State size:
32 bytes.
Comment:
Snefru-2 is not defined on bit strings, and is big-byte-endian.
Security comment:
From ftp://ftp.parc.xerox.com/pub/hash/REWARD:
In the author [Ralph Merkle]'s opinion, further security analysis of Snefru is required before it can be considered for production use.


Tiger[(digestLength[,passes])] Block MessageDigest
Designers:
Ross Anderson, Eli Biham
Published:
1996
Alias:
"OpenPGP.Digest.6" for Tiger(24,3)
Object Identifier:
1.3.6.1.4.1.11591.12.2 for Tiger(24,3)
References:
Parameters:
Digest length:
As specified by the digestLength parameter (in bytes).
Block size:
64 bytes.
Max. final block size:
55 bytes.
State size:
24 bytes.
Comments:


Whirlpool-0 Block MessageDigest
Designers:
Paulo Barreto, Vincent Rijmen
Published:
November 2000
Description:
This is the "original" version of Whirlpool submitted to the first round of the NESSIE project.
References:
Digest length:
64 bytes.
Block size:
64 bytes.
Max. final block size:
31 bytes.
State size:
64 bytes.
Comments:


Whirlpool Block MessageDigest
Designers:
Paulo Barreto, Vincent Rijmen
Published:
September 2001
Alias:
"Whirlpool-1"
Description:
This is the "tweaked" version of Whirlpool.
References:
Digest length:
64 bytes.
Block size:
64 bytes.
Max. final block size:
31 bytes.
State size:
64 bytes.
Comments:


× MGF1(digest) MessageDigest Construction
Designers:
Mihir Bellare, Phillip Rogaway, P1363 Working Group
Published:
1999
Description:
MGF1 is defined as:
MGF1(digest)(input) =
    digest(input || I2OSP4(0)) ||
    digest(input || I2OSP4(1)) ||
    digest(input || I2OSP4(2)) || ...
The maximum output length is (232 - 1) × (output length of digest).

This is the same as the definition given in PKCS #1 v2.0.
See the comments below concerning compatibility with IEEE P1363a.

References:
Parameters:
Missing information:
Test vectors when used with a little-bit-endian hash function.
Comments:
Security comment:
In section 12.3 of the cited paper by Victor Shoup, use of MGF1 (which is referred to there as "KDF1") for applications that require entropy smoothing, is criticised as being dependent on the security of "a quite unorthodox construction that does not appear to be based on any well-worn or otherwise sound principles."


Parallel(digestNames+) MessageDigest Construction
Description:
This output of this algorithm is obtained by concatenating the outputs of each of the listed algorithms. For example, "Parallel(SHA-1,RIPEMD-160)" produces a 40-byte output, the first half of which is calculated by applying SHA-1 to the input, and the second half by applying RIPEMD-160. Any non-zero number of algorithms may be listed, separated by commas.
Parameters:
Digest length:
The sum of the digest lengths of the component algorithms.
Security comments:

Alleged MessageDigests


Valid HTML 4.0 Valid CSS Copyright and trademarks