Wikipedia relies on your donations: please give today.
Our Goal: $6 million
Donate Now »
Support Wikipedia: a non-profit project
Donate Now »

Whirlpool (cryptography)

From Wikipedia, the free encyclopedia

Jump to: navigation, search
"WHIRLPOOL" redirects here. This article is about the algorithm. For other uses, see Whirlpool (disambiguation).

Whirlpool (sometimes styled WHIRLPOOL) is a cryptographic hash function designed by Vincent Rijmen (co-creator of the Advanced Encryption Standard) and Paulo S. L. M. Barreto. The hash has been recommended by the NESSIE project. It has also been adopted by the International Organization for Standardization (ISO) and the International Electrotechnical Commission (IEC) as part of the joint ISO/IEC 10118-3 international standard.

The Whirlpool Galaxy (M51), which inspired the name of the algorithm .



[edit] Design features

Whirlpool is a hash designed after the Square block cipher. Whirlpool is a Miyaguchi-Preneel construction based on a substantially modified Advanced Encryption Standard (AES). Given a message less than 2256 bits in length, it returns a 512-bit message digest.[1]

The authors have declared that "WHIRLPOOL is not (and will never be) patented. It may be used free of charge for any purpose. The reference implementations are in the public domain."

The algorithm is named after the Whirlpool Galaxy in Canes Venatici.

Two of the first widely-used mainstream cryptographic programs that started using Whirlpool were FreeOTFE, followed by TrueCrypt in 2005.

[edit] Version changes

The original Whirlpool will be called Whirlpool-0, the first revision of Whirlpool will be called Whirlpool-T and the latest version will be called Whirlpool in the following test vectors.

  • In the first revision in 2001, the s-box was changed from a randomly generated one with good cryptographic properties to one which has better cryptographic properties and is easier to implement in hardware.
  • In the second revision (2003), a flaw in the diffusion matrix was found that lowered the estimated security of the algorithm below its potential.[2] Changing the 8x8 rotating matrix constants from (1, 1, 3, 1, 5, 8, 9, 5) to (1, 1, 4, 1, 8, 5, 2, 9) solved this issue.

[edit] Whirlpool hashes

The Whirlpool algorithm has undergone two revisions since its original 2000 specification.

People incorporating Whirlpool will most likely use the most recent revision of Whirlpool; while there are no known security weaknesses in earlier versions of Whirlpool, the most recent revision has better hardware implementation efficiency characteristics, and is also likely to be more secure. As mentioned earlier, it is also the version adopted in the ISO/IEC 10118-3 international standard.

The 512-bit (64-byte) Whirlpool hashes (also termed message digests) are typically represented as 128-digit hexadecimal numbers. The following demonstrates a 43-byte ASCII input and the corresponding Whirlpool hashes:

 Whirlpool-0("The quick brown fox jumps over the lazy dog") =

 Whirlpool-T("The quick brown fox jumps over the lazy dog") =

 Whirlpool("The quick brown fox jumps over the lazy dog") =

Even a small change in the message will (with an extremely high probability of 1-10-154) result in a different hash, which will usually look completely different just like two unrelated random numbers do. The following demonstrates the result of changing the previous input by a single letter, replacing d with e:

 Whirlpool-0("The quick brown fox jumps over the lazy eog") =

 Whirlpool-T("The quick brown fox jumps over the lazy eog") =
 Whirlpool("The quick brown fox jumps over the lazy eog") =

Adding a line feed to the string of characters would also completely change the resulting hash, even if the character itself is not displayed.

The hash of a zero-length string is:

 Whirlpool-0("") =

 Whirlpool-T("") =

 Whirlpool("") =

[edit] Programming Examples

Language Source Output
PHP 5.0 echo hash( 'whirlpool', 'test' );
Ruby puts Whirlpool.calc_hex('test')

[edit] See also

[edit] References

  1. ^ Barreto, Paulo S.L.M. and Rijmen, Vincent (2003). "The WHIRLPOOL Hashing Function" (PDF). Retrieved on 2007-11-21.
  2. ^ Kyoji, Shibutani and Shirai, Taizo (2003). "On the diffusion matrix employed in the Whirlpool hashing function" (PDF). Retrieved on 2007-11-21.

[edit] External links

Personal tools