Content deleted Content added
Maths formulas |
More text. |
||
Line 3:
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 (cryptography)|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 block cipher used is secure. Note that just as with normal specialised hash functions the last block needs to be properly [[Padding (cryptography)|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.)▼
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
== Davies-Meyer ==
|