All Topics  
Cryptographic hash function

 

   Email Print
   Bookmark   Link






 

Cryptographic hash function



 
 
A cryptographic hash function is a deterministic procedure
Algorithm

In mathematics, computing, linguistics and related subjects, an algorithm is a sequence of finite instructions, often used for calculation and data processing....
 that takes an arbitrary block of data
DATA

Debt, AIDS, Trade in Africa is a multinational Non-governmental organization founded in January 2002 in London by U2's Bono along with Robert Sargent Shriver III and activists from the Jubilee 2000 Drop the Debt campaign....
 and returns a fixed-size bit
Bit

A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
 string, the hash value, such that an accidental or intentional change to the data will almost certainly change the hash value. In many contexts, especially telecommunications, the data to be encoded are often called the "message", and the hash value is also called the message digest or simply digest.

The ideal hash function
Hash function

A hash function is any algorithm or function which converts a large, possibly variable-sized amount of data into a small datum, usually a single integer that may serve as an array index into an array....
 has four main properties: These requirements call for the use of advanced cryptography techniques, hence the name.

Cryptographic hash functions have many applications, such as message integrity checks, digital signature
Digital signature

A digital signature or digital signature scheme is a type of asymmetric key algorithm. For messages sent through an insecure channel, a properly implemented digital signature gives the receiver reason to believe the message was sent by the claimed sender....
s, authentication
Authentication

Authentication is the act of establishing or confirming something as authentic, that is, that claims made by or about the subject are true....
, and various information security
Information security

Information security means protecting information and information systems from unauthorized access, use, disclosure, disruption, modification or destruction....
 applications.






Discussion
Ask a question about 'Cryptographic hash function'
Start a new discussion about 'Cryptographic hash function'
Answer questions from other users
Full Discussion Forum



Encyclopedia


A cryptographic hash function is a deterministic procedure
Algorithm

In mathematics, computing, linguistics and related subjects, an algorithm is a sequence of finite instructions, often used for calculation and data processing....
 that takes an arbitrary block of data
DATA

Debt, AIDS, Trade in Africa is a multinational Non-governmental organization founded in January 2002 in London by U2's Bono along with Robert Sargent Shriver III and activists from the Jubilee 2000 Drop the Debt campaign....
 and returns a fixed-size bit
Bit

A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
 string, the hash value, such that an accidental or intentional change to the data will almost certainly change the hash value. In many contexts, especially telecommunications, the data to be encoded are often called the "message", and the hash value is also called the message digest or simply digest.

The ideal hash function
Hash function

A hash function is any algorithm or function which converts a large, possibly variable-sized amount of data into a small datum, usually a single integer that may serve as an array index into an array....
 has four main properties:
  • it is easy to compute the hash for any given data,
  • it is extremely difficult
    Computational complexity theory

    Computational complexity theory, as a branch of the theory of computation in computer science, investigates the problems related to the Computational resource required for the execution of algorithms , and the inherent difficulty in providing efficient algorithms for specific computational problems....
     to construct a text that has a given hash,
  • it is extremely difficult to modify a given text without changing its hash,
  • it is extremely unlikely that two different messages will have the same hash.
These requirements call for the use of advanced cryptography techniques, hence the name.

Cryptographic hash functions have many applications, such as message integrity checks, digital signature
Digital signature

A digital signature or digital signature scheme is a type of asymmetric key algorithm. For messages sent through an insecure channel, a properly implemented digital signature gives the receiver reason to believe the message was sent by the claimed sender....
s, authentication
Authentication

Authentication is the act of establishing or confirming something as authentic, that is, that claims made by or about the subject are true....
, and various information security
Information security

Information security means protecting information and information systems from unauthorized access, use, disclosure, disruption, modification or destruction....
 applications. Their hash values can also be used as fingerprint
Fingerprint (computing)

In computer science, a fingerprinting algorithm is a procedure that maps an arbitrarily large data item to a much shorter bit string, its fingerprint, that uniquely identifies the original data for all practical purposes...
s for detecting duplicate data files, file version changes, and similar applications, or as checksums to guard against accidental data corruption. Indeed, cryptographic hash values are often called (digital) fingerprints or checksums, although these are somewhat different concepts. Cryptographic hash functions should not be confused with plain hash functions which are used to map data to indices into a hash table
Hash table

In computer science, a hash table, or a hash map, is a data structure that associates Unique key with value .The primary operation that hash functions support efficiently is a lookup: given a key , find the corresponding value ....
.

In various standards and applications, the two most commonly used hash functions are MD5
MD5

In cryptography, MD5 is a widely used cryptographic hash function with a 128-bit hash value. As an Internet standard , MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of computer file....
 and SHA-1 (other well known hash functions are listed below). In 2005, security flaws were identified in both of these, namely that a possible mathematical weakness might exist, indicating that a stronger hash function would be desirable. The function SHA-256 seems free from those weaknesses. In 2007 the National Institute of Standards and Technology
National Institute of Standards and Technology

The National Institute of Standards and Technology , known between 1901 and 1988 as the National Bureau of Standards , is a measurement standards laboratory which is a non-regulatory agency of the United States Department of Commerce....
 announced a contest to design a hash function
NIST hash function competition

The NIST hash function competition refers to an open competition held by the US National Institute of Standards and Technology for a new SHA-3 function to replace the older SHA hash functions, which was formally announced in the Federal Register on November 2, 2007....
 which will be given the name SHA-3
SHA hash functions

The SHA hash functions are a set of cryptographic hash functions designed by the National Security Agency and published by the National Institute of Standards and Technology as a U.S....
 and be the subject of a FIPS
Federal Information Processing Standard

Federal Information Processing Standards are publicly announced Standardizations developed by the United States Federal government for use by all non-military government agencies and by government contractors....
 standard.

Overview

Most cryptographic hash functions are designed to take a string
String (computer science)

In computer programming and some branches of mathematics, a string is an ordered sequence of symbols. These symbols are chosen from a predetermined set or alphabet....
 of any length as input and produce a fixed-length hash value. The four basic properties listed above imply that not even a malicious adversary
Adversary (cryptography)

In cryptography, an adversary is a malicious entity whose aim is to prevent the users of the cryptosystem from achieving their goal . An adversary's efforts might take the form of attempting to discover secret data, corrupting some of the data in the system, Spoofing attacking the identity of a message sender or receiver, or forcing system d...
 can replace or modify the input data without changing its digest. Thus, if two strings have the same digest, one can be very confident that they are identical.

Ideally, one may wish for even stronger conditions. It should be impossible for an adversary to find two messages with substantially similar digests; or infer any useful information about the data, given only its digest. Therefore, a cryptographic hash function should behave as much as possible like a random function
Random function

A random function is a function chosen at random from a finite family of functions. Typically, the family consists of the set of all maps from the domain to the image set....
 while still being deterministic and efficiently computable.

Related algorithms

Checksum
Checksum

A checksum or hash sum is a fixed-size data computed from an arbitrary block of digital data for the purpose of error detection that may have been introduced during its telecommunications or computer storage....
s and cyclic redundancy check
Cyclic redundancy check

A cyclic redundancy check is a type of function that takes as input a data stream of any length, and produces as output a value of a certain space, commonly a 32-bit integer....
s (CRCs) are quite distinct from cryptographic hash functions, and are used for different applications. If used for security, they are vulnerable to attack; for example, a CRC was used for message integrity in the WEP
Wired Equivalent Privacy

Wired Equivalent Privacy is a Deprecation algorithm to secure IEEE 802.11 wireless computer network. Wireless networks broadcast messages using radio and are thus more susceptible to eavesdropping than wired networks....
 encryption standard, but an attack was readily discovered which exploited the linearity of the checksum specified.

A message authentication code
Message authentication code

A cryptography message authentication code is a short piece of information used to authenticate a message.A MAC algorithm accepts as input a secret key and an arbitrary-length message to be authenticated, and outputs a MAC ....
 (MAC) takes a message and a secret key and generates a "MAC tag", such that it is difficult for an attacker to generate a valid pair (message, tag) that doesn't match one they've already seen; they are used to prevent attackers forging messages, among other uses. Though it is sometimes referred to as a "keyed hash function", a MAC serves a very different purpose and has very different security properties than a cryptographic hash function; for example, it is not considered a flaw if it is easy for someone who knows the MAC key to generate two messages that have the same MAC. Hash functions can be used to create MAC functions; see for example HMAC
HMAC

In cryptography, a keyed-Hash Message Authentication Code , is a type of message authentication code calculated using a specific algorithm involving a cryptographic hash function in combination with a secret cryptographic key....
.

Cryptographic properties


There is no formal definition which captures all of the properties considered desirable for a cryptographic hash function. These properties below are generally considered prerequisites:
  • Preimage resistant
    Preimage attack

    In cryptography, a preimage attack on a Cryptographic hash function is an attempt to find a message that has a specific hash value. There are two types of preimage attacks:...
     (See one way function for a related but slightly different property): given h it should be hard to find any m such that h = hash(m).
  • Second preimage resistant
    Preimage attack

    In cryptography, a preimage attack on a Cryptographic hash function is an attempt to find a message that has a specific hash value. There are two types of preimage attacks:...
    : given an input m1, it should be hard to find another input, m2 (not equal to m1) such that
This property is implied by collision-resistance. Second preimage resistance is sometimes referred to as weak collision resistance
Hash collision

In computer science, a hash collision or hash clash is a situation that occurs when two distinct inputs into a hash function produce identical outputs....
.
  • Collision-resistant: it should be hard to find two different messages m1 and m2 such that hash(m1) = hash(m2). Due to a possible birthday attack
    Birthday attack

    A birthday attack is a type of cryptography attack, so named because it exploits the mathematics behind the birthday problem in probability theory....
    , this means the hash function output must be at least twice as large as what is required for preimage-resistance. This property is sometimes referred to as strong collision resistance
    Hash collision

    In computer science, a hash collision or hash clash is a situation that occurs when two distinct inputs into a hash function produce identical outputs....
    .


A hash function meeting these criteria may still have undesirable properties. For instance, many popular hash functions are vulnerable to length-extension attacks: given h(m) and len(m) but not m, by choosing a suitable m' an attacker can calculate h (m || m'), where || denotes concatenation
Concatenation

In computer programming, string concatenation is the operation of joining two character string end to end. For example, the strings "snow" and "ball" may be concatenated to give "snowball"....
. This property can be used to break naive authentication schemes based on hash functions. The HMAC
HMAC

In cryptography, a keyed-Hash Message Authentication Code , is a type of message authentication code calculated using a specific algorithm involving a cryptographic hash function in combination with a secret cryptographic key....
 construction works around these problems.

It is however, a common misconception that "one-wayness" of a cryptographic hash function means irreversibility of processing of the hash state, and that it somehow contradicts the principles used to construct block ciphers. Such "irreversibility" in fact means presence of local collisions that could facilitate attacks. The hash function must be a permutation processing its state bijectively to be cryptographically secure. It must be irreversible regarding the data block just like any block cipher must be irreversible regarding the key (it should be impossible to find the key that can encrypt a block A into a block B faster than the brute-force). This makes iterated block ciphers and hash functions processing blocks of the same size as secret keys of those block ciphers virtually identical, except the roles of key and data blocks are swapped. All the attacks against the MDx and SHA families of hash functions exploit local collisions in the processing of the data block. The local collisions caused by the final addition operation can also be exploited by these attacks.

Applications

A typical use of a cryptographic hash would be as follows: Alice
Alice and Bob

Placeholder names are commonly used for archetypal characters in fields such as cryptography and physics. The names are used for convenience, since explanations such as "Person A wants to send a message to person B" can be difficult to follow in complex systems involving many steps....
 poses a tough math problem to Bob
Alice and Bob

Placeholder names are commonly used for archetypal characters in fields such as cryptography and physics. The names are used for convenience, since explanations such as "Person A wants to send a message to person B" can be difficult to follow in complex systems involving many steps....
, and claims she has solved it. Bob would like to try it himself, but would yet like to be sure that Alice is not bluffing. Therefore, Alice writes down her solution, appends a random nonce
Cryptographic nonce

In security engineering, a nonce stands for number used once . It is often a randomness or pseudo-random number issued in an authentication protocol to ensure that old communications cannot be reused in replay attacks....
, computes its hash and tells Bob the hash value (whilst keeping the solution and nonce secret). This way, when Bob comes up with the solution himself a few days later, Alice can prove that she had the solution earlier by revealing the nonce to Bob. (This is an example of a simple commitment scheme
Commitment scheme

In cryptography, a commitment scheme or a bit commitment scheme is a method that allows a user to commit to a value while keeping it hidden and preserving the user's ability to reveal the committed value later....
; in actual practice, Alice and Bob will often be computer programs, and the secret would be something less easily spoofed than a claimed puzzle solution).

Another important application of secure hashes is verification of message integrity. Determining whether any changes have been made to a message (or a file
Computer file

A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable computer storage....
), for example, can be accomplished by comparing message digests calculated before, and after, transmission (or any other event).

A message digest can also serve as a means of reliably identifying a file; several source code management systems, including Git
Git (software)

Git is a free software distributed revision control, or software source code management project with an emphasis on being fast. Git was initially created by Linus Torvalds for Linux kernel development....
, Mercurial
Mercurial (software)

Mercurial is a cross-platform, distributed revision control tool for software developers. It is mainly implemented using the Python , but includes a binary diff implementation written in C ....
 and Monotone
Monotone (software)

Monotone is an open source software tool for distributed revision control. Monotone tracks revisions to files, groups sets of revisions into changesets, and tracks history across renames....
, use the sha1sum
Sha1sum

sha1sum is a computer program which calculates and verifies SHA hash functions Cryptographic hash function. It is commonly used to verify the integrity of files....
 of various types of content (file content, directory trees, ancestry information, etc) to uniquely identify them.

A related application is password
Password

A password is a secret word or string of Character that is used for authentication, to prove identity or gain access to a resource . The password must be kept Secrecy from those not allowed access....
 verification. Passwords are usually not stored in cleartext
Cleartext

In data communications, cleartext is the form of a message or data which is in a form that is immediately comprehensible to a human being without additional processing....
, for obvious reasons, but instead in digest form. To authenticate a user, the password presented by the user is hashed and compared with the stored hash. This is sometimes referred to as one-way encryption
One-way encryption

In cryptography, the term "one-way encryption" has been used to refer to a number of different things:*One-way function, a function difficult to inverse function....
.

For both security and performance reasons, most digital signature
Digital signature

A digital signature or digital signature scheme is a type of asymmetric key algorithm. For messages sent through an insecure channel, a properly implemented digital signature gives the receiver reason to believe the message was sent by the claimed sender....
 algorithms specify that only the digest of the message be "signed", not the entire message. Hash functions can also be used in the generation of pseudorandom bits.

SHA-1, MD5
MD5

In cryptography, MD5 is a widely used cryptographic hash function with a 128-bit hash value. As an Internet standard , MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of computer file....
, and RIPEMD-160 are among the most commonly-used message digest algorithms as of 2005. In August 2004, researchers found weaknesses in a number of hash functions, including MD5, SHA-0 and RIPEMD. This has called into question the long-term security of later algorithms which are derived from these hash functions — in particular, SHA-1 (a strengthened version of SHA-0), RIPEMD-128, and RIPEMD-160 (both strengthened versions of RIPEMD). Neither SHA-0 nor RIPEMD are widely used since they were replaced by their strengthened versions. In February 2005, an attack on SHA-1 was reported, finding collisions in about 269 hashing operations, rather than the 280 expected for a 160-bit hash function. In August 2005, another attack on SHA-1 was reported, finding collisions in 263 operations.

Hashes are used to identify files on peer-to-peer
Peer-to-peer

A peer-to-peer computer network uses diverse connectivity between participants in a network and the cumulative bandwidth of network participants rather than conventional centralized resources where a relatively low number of Server s provide the core value to a service or application....
 filesharing networks. For example, in an ed2k link, an MD4
MD4

MD4 is a message digest algorithm designed by Professor Ronald Rivest of Massachusetts Institute of Technology in 1990. It implements a cryptographic hash function for use in message integrity checks....
-variant hash is combined with the file size, providing sufficient information for locating file sources, downloading the file and verifying its contents. Magnet links are another example. Such file hashes are often the top hash of a hash list
Hash list

In computer science, a hash list is typically a List of Hash function of the data blocks in a file or set of files. Lists of hashes are used for many different purposes, such as fast table lookup and distributed databases ....
 or a hash tree
Hash tree

In cryptography and computer science Hash trees or Merkle trees are a type of data structure which contains a Tree of summary information about a larger piece of data ? for instance a file ? used to verify its contents....
 which allows for additional benefits.

Merkle-Damgård construction


A hash function must be able to process an arbitrary-length message into a fixed-length output. This can be achieved by breaking the input up into a series of equal-sized blocks, and operating on them in sequence using a one-way compression function. The compression function can either be specially designed for hashing or be built from a block cipher. A hash function built with the Merkle-Damgård construction is as resistant to collisions as is its compression function; any collision for the full hash function can be traced back to a collision in the compression function.

The last block processed should also be unambiguously length padded
Padding (cryptography)

In cryptography, padding refers to a number of distinct practices....
; this is crucial to the security of this construction. This construction is called the Merkle-Damgård construction. Most widely used hash functions, including SHA-1 and MD5
MD5

In cryptography, MD5 is a widely used cryptographic hash function with a 128-bit hash value. As an Internet standard , MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of computer file....
, take this form.

The construction has certain inherent flaws, including length-extension and generate-and-paste attacks, and cannot be parallelized. As a result, many entrants in the current NIST hash function competition
NIST hash function competition

The NIST hash function competition refers to an open competition held by the US National Institute of Standards and Technology for a new SHA-3 function to replace the older SHA hash functions, which was formally announced in the Federal Register on November 2, 2007....
 are built on different, sometimes novel, constructions.

Hash functions based on block ciphers

There are several methods to use a block cipher
Block cipher

In cryptography, a block cipher is a symmetric key algorithm cipher which operates on fixed-length groups of bits, termed blocks, with an unvarying transformation....
 to build a cryptographic hash function. The methods resemble the block cipher modes of operation
Block cipher modes of operation

In cryptography, a block cipher operates on blocks of fixed length, often 64 or 128 bits. Because messages may be of any length, and because encrypting the same plaintext under the same key always produces the same output , several modes of operation have been invented which allow block ciphers to provide confidentiality for messages of arbit...
 usually used for encryption. All well-known hash functions, including MD4, MD5, SHA-1 and SHA-2 are built from block-cipher-like components designed for the purpose, with feedback to ensure that the resulting function is not bijective.

A standard block cipher such as AES
Advanced Encryption Standard

In cryptography, the Advanced Encryption Standard is an encryption standard adopted by the Federal government of the United States. The standard comprises three block ciphers, AES-128, AES-192 and AES-256, adopted from a larger collection originally published as Rijndael. Each AES cipher has a 128 bit block size, with key sizes of 128...
 can be used in place of these custom block ciphers; this generally carries a cost in performance, but can be advantageous where a system needs to perform hashing and another cryptographic function such as encryption that might use a block cipher, but is constrained in the code size or hardware area it must fit into, such as in some embedded system
Embedded system

An embedded system is a special-purpose computer system designed to perform one or a few dedicated functions, often with real-time computing constraints....
s like smart card
Smart card

A smart card, chip card, or integrated circuit card , is in any pocket-sized card with embedded integrated circuits which can process data....
s.

Methods to make hash functions from block ciphers

See one-way compression function for details.

  • Davies-Meyer
  • Matyas-Meyer-Oseas
  • Miyaguchi-Preneel
    Bart Preneel

    Bart Preneel is a Belgium cryptographer and cryptanalyst. He is a professor at Katholieke Universiteit Leuven, in the COSIC group, president of the International Association for Cryptologic Research, and project manager of ECRYPT....
  • MDC-2
  • MDC-4


Use in building other cryptographic primitives

Hash functions can be used to build other cryptographic primitives. For these other primitives to be cryptographically secure, care must be taken to build them correctly.

Message authentication code
Message authentication code

A cryptography message authentication code is a short piece of information used to authenticate a message.A MAC algorithm accepts as input a secret key and an arbitrary-length message to be authenticated, and outputs a MAC ....
s (MACs) are often built from hash functions. HMAC
HMAC

In cryptography, a keyed-Hash Message Authentication Code , is a type of message authentication code calculated using a specific algorithm involving a cryptographic hash function in combination with a secret cryptographic key....
 is such a MAC.

Just as block cipher
Block cipher

In cryptography, a block cipher is a symmetric key algorithm cipher which operates on fixed-length groups of bits, termed blocks, with an unvarying transformation....
s can be used to build hash functions, hash functions can be used to build block ciphers. Luby-Rackoff constructions using hash functions can be provably secure if the underlying hash function is secure. Also, many hash functions (including the SHA hash functions
SHA hash functions

The SHA hash functions are a set of cryptographic hash functions designed by the National Security Agency and published by the National Institute of Standards and Technology as a U.S....
) are built by using a special-purpose block cipher in a Davies-Meyer or other construction; that cipher can also be used in a conventional mode of operation, without the same security guarantees. See SHACAL
SHACAL

In cryptography, SHACAL-1 and SHACAL-2 are block ciphers based on cryptographic hash functions from the SHA hash functions. They were designed by Helena Handschuh and David Naccache of the smart card manufacturer Gemplus....
, BEAR and LION.

Pseudorandom number generator
Pseudorandom number generator

A pseudorandom number generator is an algorithm for generating a sequence of numbers that approximates the properties of random numbers. The sequence is not truly random in that it is completely determined by a relatively small set of initial values, called the PRNG's state. Although sequences that are closer to truly random can be gen...
s (PRNGs) can be built using hash functions. This is done by combining a (secret) random seed with a counter and hashing it.

Stream cipher
Stream cipher

In cryptography, a stream cipher is a symmetric key algorithm cipher where plaintext bits are combined with a pseudorandom cipher bit stream , typically by an exclusive-or operation....
s can be built using hash functions. Often this is done by first building a cryptographically secure pseudorandom number generator
Cryptographically secure pseudorandom number generator

A cryptographically secure pseudo-random number generator is a pseudo-random number generator with properties that make it suitable for use in cryptography....
 and then using its stream of random bytes as keystream
Keystream

In cryptography, a keystream is a Stream of Randomness or Pseudorandomness characters that are combined with a plaintext message to produce an encrypted message ....
. SEAL
SEAL (cipher)

In cryptography, SEAL is a very fast stream cipher optimised for machines with a 32-bit word size and plenty of Random Access Memory. SEAL is actually a pseudorandom function family in that it can easily generate arbitrary portions of the keystream without having to start from the beginning....
 is a stream cipher that uses SHA-1 to generate internal tables, which are then used in a keystream generator more or less unrelated to the hash algorithm; SEAL is not guaranteed to be as strong (or weak) as SHA-1.

Concatenation of cryptographic hash functions


Concatening outputs from multiple hash functions provides collision resistance at least as good as the strongest of the algorithms included in the concatenated result. For example, SSL
Transport Layer Security

Transport Layer Security and its predecessor, Secure Sockets Layer , are cryptographic protocols that provide security and data integrity for communications over Internet Protocol Suite networks such as the Internet....
 uses concatenated MD5
MD5

In cryptography, MD5 is a widely used cryptographic hash function with a 128-bit hash value. As an Internet standard , MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of computer file....
 and SHA-1 sums to ensure the protocol will remain secure even if one function is broken.

However, for Merkle-Damgård hash functions, the concatenated function is only as strong as the best component, not stronger. Joux noted that 2-collisions lead to n-collisions: if it's feasible to find two messages with the same MD5 hash, it's effectively no more difficult to find as many messages as the attacker desires with identical MD5 hashes. Among the n messages with the same MD5 hash, there's likely to be a collision in SHA-1. The additional work needed to find the SHA-1 collision (beyond the exponential birthday search) is polynomial
Polynomial time

In computational complexity theory, polynomial time refers to the computation time of a problem where the run time, , is no greater than a polynomial function of the problem size, n....
. This argument is summarized by .

List of cryptographic hash functions

Some of the following algorithms are known to be insecure; consult the article for each specific algorithm for more information on the status of each algorithm. Note that this list doesn't include candidates in the current NIST hash function competition
NIST hash function competition

The NIST hash function competition refers to an open competition held by the US National Institute of Standards and Technology for a new SHA-3 function to replace the older SHA hash functions, which was formally announced in the Federal Register on November 2, 2007....
. For even more hash functions see the box at the bottom of the page.

AlgorithmOutput size (bits)Internal state sizeBlock sizeLength sizeWord sizeCollision attack (complexity)Pre-image attack (complexity)
HAVAL
HAVAL

HAVAL is a cryptographic hash function. Unlike MD5, but like most modern cryptographic hash functions, HAVAL can produce hashes of different lengths....
 
256/224/192/160/128 256 1024 64 32 Yes
MD2 128 384 128 No 8 Almost
MD4
MD4

MD4 is a message digest algorithm designed by Professor Ronald Rivest of Massachusetts Institute of Technology in 1990. It implements a cryptographic hash function for use in message integrity checks....
 
128 128 512 64 32 Yes (2^8) With flaws (2^102)
MD5
MD5

In cryptography, MD5 is a widely used cryptographic hash function with a 128-bit hash value. As an Internet standard , MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of computer file....
 
128 128 512 64 32 Yes (2^5) No
PANAMA
Panama

Panama, officially the Republic of Panama , is the southernmost country of Central America and, in turn, North America. Situated on an isthmus connecting North and South America, some categorize it as a transcontinental nation....
 
256 8736 256 No 32 Yes
RadioGatún Arbitrarily long 58 words 3 words No 1-64 No
RIPEMD
RIPEMD

RIPEMD-160 is a 160-bit message digest algorithm developed in Leuven by Hans Dobbertin, Antoon Bosselaers and Bart Preneel at the COSIC research group at the Katholieke Universiteit Leuven, and first published in 1996....
 
128 128 512 64 32 Yes
RIPEMD-128/256
RIPEMD

RIPEMD-160 is a 160-bit message digest algorithm developed in Leuven by Hans Dobbertin, Antoon Bosselaers and Bart Preneel at the COSIC research group at the Katholieke Universiteit Leuven, and first published in 1996....
 
128/256 128/256 512 64 32 No
RIPEMD-160/320
RIPEMD

RIPEMD-160 is a 160-bit message digest algorithm developed in Leuven by Hans Dobbertin, Antoon Bosselaers and Bart Preneel at the COSIC research group at the Katholieke Universiteit Leuven, and first published in 1996....
 
160/320 160/320 512 64 32 No
SHA-0
SHA hash functions

The SHA hash functions are a set of cryptographic hash functions designed by the National Security Agency and published by the National Institute of Standards and Technology as a U.S....
 
160 160 512 64 32 Yes (2^39)
SHA-1
SHA hash functions

The SHA hash functions are a set of cryptographic hash functions designed by the National Security Agency and published by the National Institute of Standards and Technology as a U.S....
 
160 160 512 64 32 With flaws (2^63) No
SHA-256/224
SHA hash functions

The SHA hash functions are a set of cryptographic hash functions designed by the National Security Agency and published by the National Institute of Standards and Technology as a U.S....
 
256/224 256 512 64 32 No No
SHA-512/384
SHA hash functions

The SHA hash functions are a set of cryptographic hash functions designed by the National Security Agency and published by the National Institute of Standards and Technology as a U.S....
 
512/384 512 1024 128 64 No No
Tiger(2)-192/160/128 192/160/128 192 512 64 64 No
WHIRLPOOL
Whirlpool

A whirlpool is a swirling body of water usually produced by ocean tides. The vast majority of whirlpools are not very powerful. More powerful ones are more properly termed maelstroms....
 
512 512 512 256 8 No


The SHA hash functions
SHA hash functions

The SHA hash functions are a set of cryptographic hash functions designed by the National Security Agency and published by the National Institute of Standards and Technology as a U.S....
 are a series of functions developed by the NSA: SHA, also known as SHA-0, SHA-1 and four flavours of a function known as SHA-2.

Note: The internal state here means the "internal hash sum" after each compression of a data block. Most hash algorithms also internally use some additional variables such as length of the data compressed so far since that is needed for the length padding in the end. See the Merkle-Damgård construction for details.

See also


Further reading

  • Bruce Schneier
    Bruce Schneier

    Bruce Schneier is an American cryptographer, computer security specialist, and writer. He is the author of several books on computer security and cryptography, and is the founder and chief technology officer of BT Counterpane, formerly Counterpane Internet Security, Inc....
    . Applied Cryptography. John Wiley & Sons, 1996. ISBN 0-471-11709-9.


External links

  •  — a list of hash functions and known attacks, by Paulo Barreto
    Paulo S. L. M. Barreto

    Paulo S. L. M. Barreto is a Brazilian cryptographer and one of the designers of the Whirlpool cryptographic hash function and the block ciphers Anubis and KHAZAD, together with Vincent Rijmen....
  •  — a survey by Ilya Mironov (Microsoft Research)
  • by Steve Friedl
  • by Bruce Schneier
    Bruce Schneier

    Bruce Schneier is an American cryptographer, computer security specialist, and writer. He is the author of several books on computer security and cryptography, and is the founder and chief technology officer of BT Counterpane, formerly Counterpane Internet Security, Inc....
  • from RSA Laboratories
  • by James McGlinn at the PHP Security Consortium
  • by Val Henson, "in language that any programmer (and even some managers) can understand."
  • with various algorithms
  • Windows shell extension to display file hashes
  • An online hash generator (crc16, crc32, md2, md4, md5, ntlm, mysql323, sha, ripemd, and other forty four algos)