One-way compression function

This is an old revision of this page, as edited by Davidgothberg (talk | contribs) at 12:47, 26 January 2006 (More text.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
This page is currently in the process of having information merged to it from the following articles: Davies-Meyer hash, Miyaguchi-Preneel hash and Matyas-Meyer-Oseas hash

In cryptography, there are several methods to use a block cipher to build a cryptographic hash function. The methods resembles the block cipher modes of operation usually used for encryption. Three such methods to turn any normal block cipher into a hash are Davies-Meyer, Miyaguchi-Preneel and Matyas-Meyer-Oseas.

Using a block cipher as a hash function usually is much slower then using a specially designed hash function. But in some cases it might be easier since it means just implementing a block cipher and then using it both as a block cipher and a hash function. It can also save code space in very tiny embedded systems like for instance smart cards or nodes in cars or other machines.

If a block cipher has a block size of say 128 bits most of the methods create a hash function that has the block size of 128 bits and produces a hash of 128 bits. But there are also methods to make hashes with double the hash size compared to the block size of the block cipher used. So a 128-bit block cipher can be turned into a 256-bit hash function.

The hash function is secure if the following conditions are met:

  • The block cipher needs to be secure.
  • The resulting hash size needs to be big enough. 64-bit is too small, 128-bit might be enough.
  • The last block needs to be properly length padded prior to the hashing. (This is normally implemented and handled internally in specialised hash functions like SHA-1 etc.)

Davies-Meyer

File:Davies-Meyer hash.png
The Davies-Meyer hash construction


 



Matyas-Meyer-Oseas

File:Matyas-Meyer-Oseas hash.png
The Matyas-Meyer-Oseas hash construction


 



Miyaguchi-Preneel

File:Miyaguchi-Preneel hash.png
The Miyaguchi-Preneel hash construction