One-way compression function
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.
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 block size and 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 block cipher used is secure. Note that just as with normal specialised hash functions the last block needs to be properly length padded prior to the hashing for the hash to be secure. (This is normally implemented and handled internally in most specialised hash functions like SHA-1 etc.)
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.
Davies-Meyer
Matyas-Meyer-Oseas
Miyaguchi-Preneel