Whirlpool (hash function)

Cryptographic hash function


title: "Whirlpool (hash function)" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["cryptographic-hash-functions"] description: "Cryptographic hash function" topic_path: "technology/cryptography" source: "https://en.wikipedia.org/wiki/Whirlpool_(hash_function)" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::summary Cryptographic hash function ::

::data[format=table title="Infobox encryption method"]

FieldValue
nameWhirlpool
designersVincent Rijmen, Paulo S. L. M. Barreto
publish date2000, 2001, 2003
derived fromSquare, AES
certificationNESSIE
digest size512 bits
key size
security claimLarge hashsum size
block size
state size
structureMiyaguchi-Preneel
rounds10
cryptanalysisIn 2009, a rebound attack was announced that presents full collisions against 4.5 rounds of Whirlpool in 2120 operations, semi-free-start collisions against 5.5 rounds in 2120 time and semi-free-start near-collisions against 7.5 rounds in 2128 time.{{cite conference
authorFlorian Mendel1, Christian Rechberger, Martin Schläffer, Søren S. Thomsen
date2009-02-24
titleThe Rebound Attack: Cryptanalysis of Reduced Whirlpool and Grøstl
conferenceFast Software Encryption: 16th International Workshop
urlhttps://www.cosic.esat.kuleuven.be/fse2009/slides/2402_1150_Schlaeffer.pdf
::

|name = Whirlpool |image = |caption = |designers = Vincent Rijmen, Paulo S. L. M. Barreto |publish date = 2000, 2001, 2003 |series = |derived from = Square, AES |derived to = |related to = |certification = NESSIE |digest size = 512 bits |key size =
|security claim = Large hashsum size |block size =
|state size =
|structure = Miyaguchi-Preneel |rounds = 10 |cryptanalysis = In 2009, a rebound attack was announced that presents full collisions against 4.5 rounds of Whirlpool in 2120 operations, semi-free-start collisions against 5.5 rounds in 2120 time and semi-free-start near-collisions against 7.5 rounds in 2128 time.{{cite conference | author=Florian Mendel1, Christian Rechberger, Martin Schläffer, Søren S. Thomsen | date=2009-02-24 | title=The Rebound Attack: Cryptanalysis of Reduced Whirlpool and Grøstl | conference=Fast Software Encryption: 16th International Workshop | url=https://www.cosic.esat.kuleuven.be/fse2009/slides/2402_1150_Schlaeffer.pdf

In computer science and cryptography, Whirlpool (sometimes styled WHIRLPOOL) is a cryptographic hash function. It was designed by Vincent Rijmen (co-creator of the Advanced Encryption Standard) and Paulo S. L. M. Barreto, who first described it in 2000.

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.

Design features

::figure[src="https://upload.wikimedia.org/wikipedia/commons/d/db/Messier51_sRGB.jpg" caption="The [[Whirlpool Galaxy]] (M51), which inspired the name of the algorithm.{{cite web"] ::

| url=http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html | title=The WHIRLPOOL Hash Function | author=Paulo S. L. M. Barreto | date=2008-11-25 | archive-url=https://web.archive.org/web/20171129084214/http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html | archive-date=2017-11-29 | url-status=dead | access-date=2018-08-09}}]]

Whirlpool is a hash designed after the Square block cipher, and is considered to be in that family of block cipher functions.

Whirlpool is a Miyaguchi–Preneel construction based on a substantially modified Advanced Encryption Standard (AES).

Whirlpool takes a message of any length less than 2256 bits and returns a 512-bit message digest.{{cite journal | author1=Barreto, Paulo S. L. M. | author2=Rijmen, Vincent | name-list-style=amp | title=The WHIRLPOOL Hashing Function | date=2003-05-24 | url=http://www.larc.usp.br/~pbarreto/whirlpool.zip | format=ZIP | archive-url=https://web.archive.org/web/20171026140501/http://www.larc.usp.br/%7Epbarreto/whirlpool.zip | archive-date=2017-10-26 | url-status=dead | access-date=2018-08-09}}

The authors have declared that :"WHIRLPOOL is not (and will never be) patented. It may be used free of charge for any purpose."

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.{{cite journal | title=On the diffusion matrix employed in the Whirlpool hashing function | author1=Kyoji, Shibutani | author2=Shirai, Taizo | name-list-style=amp | date=2003-03-11 | url=https://www.cosic.esat.kuleuven.be/nessie/reports/phase2/whirlpool-20030311.pdf | access-date=2018-08-09}} 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.

Internal structure

The Whirlpool hash function is a Merkle–Damgård construction based on an AES-like block cipher W in Miyaguchi–Preneel mode.

The block cipher W consists of an 8×8 state matrix S of bytes, for a total of 512 bits.

The encryption process consists of updating the state with four round functions over 10 rounds. The four round functions are SubBytes (SB), ShiftColumns (SC), MixRows (MR) and AddRoundKey (AK). During each round the new state is computed as S=AK \circ MR \circ SC \circ SB(S) .

SubBytes

The SubBytes operation applies a non-linear permutation (the S-box) to each byte of the state independently. The 8-bit S-box is composed of 3 smaller 4-bit S-boxes.

ShiftColumns

The ShiftColumns operation cyclically shifts each byte in each column of the state. Column j has its bytes shifted downwards by j positions.

MixRows

The MixRows operation is a right-multiplication of each row by an 8×8 matrix over GF({2^8}). The matrix is chosen such that the branch number (an important property when looking at resistance to differential cryptanalysis) is 9, which is maximal.

AddRoundKey

The AddRoundKey operation uses bitwise xor to add a key calculated by the key schedule to the current state. The key schedule is identical to the encryption itself, except the AddRoundKey function is replaced by an AddRoundConstant function that adds a predetermined constant in each round.

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 (not including quotes) and the corresponding Whirlpool hashes:

::data[format=table]

VersionInput StringComputed Hash
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"
::

Implementations

The authors provide reference implementations of the Whirlpool algorithm, including a version written in C and a version written in Java. These reference implementations have been released into the public domain.

Research on the security analysis of the Whirlpool function however, has revealed that on average, the introduction of 8 random faults is sufficient to compromise the 512-bit Whirlpool hash message being processed and the secret key of HMAC-Whirlpool within the context of Cloud of Things (CoTs). This emphasizes the need for increased security measures in its implementation.

Adoption

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

VeraCrypt (a fork of TrueCrypt) included Whirlpool (the final version) as one of its supported hash algorithms.{{cite web | url=https://www.veracrypt.fr/en/Whirlpool.html | title=Whirlpool | work=VeraCrypt Documentation | publisher=IDRIX | access-date=2018-08-09}}

References

References

  1. Li, W., Gao, Z., Gu, D., Ge, C., Liao, L., Zhou, Z., Liu, Y., & Liu, Z. (2017). Security Analysis of the Whirlpool Hash Function in the Cloud of Things. KSII Transactions on Internet and Information Systems, 11(1), 536–551. https://doi.org/10.3837/tiis.2017.01.028

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

cryptographic-hash-functions