In: Computer Science
Suppose we construct H from h using a modification to the Merkle-Damg ̊ard transform, where we remove the message length from the end.
Find a collision in H where the message lengths are both integer multiples of the block length.
the Merkle–Damgård construction or Merkle–Damgård hash function is a method of building collision-resistant cryptographic hash functions from collision-resistant one-way compression functions.[1]:145 This construction was used in the design of many popular hash algorithms such as MD5, SHA-1 and SHA-2. The Merkle–Damgård construction was described in Ralph .[2] Ralph Merkle and Ivan Damgård independently proved that the structure is sound: that is, if an appropriate padding scheme is used and the compression function is collision-resistant, then the hash function will also be collision-resistant. The Merkle–Damgård hash function first applies an MD-compliant padding function to create an input whose size is a multiple of a fixed number (e.g. 512 or 1024) — this is because compression functions cannot handle inputs of arbitrary size. The hash function then breaks the result into blocks of fixed size, and processes them one at a time with the compression function, each time combining a block of the input with the output of the previous round.[1]:In order to make the construction secure, Merkle and Damgård proposed that messages be padded with a padding that encodes the length of the original message. This is called length padding or Merkle–Damgård strengthening..........................................................
A hash table is a collection of items which are
stored in such a way as to make it easy to find them later. Each
position of the hash table, often called a slot,
can hold an item and is named by an integer value starting at 0.
For example, we will have a slot named 0, a slot named 1, a slot
named 2, and so on. Initially, the hash table contains no items so
every slot is empty. We can implement a hash table by using a list
with each element initialized to the special Python value
None
. Figure 4 shows a hash table of size m=11m=11. In
other words, there are m slots in the table, named 0
through 10.
Figure : Hash Table with 11 Empty Slots
The mapping between an item and the slot where that item belongs in the hash table is called the hash function. The hash function will take any item in the collection and return an integer in the range of slot names, between 0 and m-1. Assume that we have the set of integer items 54, 26, 93, 17, 77, and 31. Our first hash function, sometimes referred to as the “remainder method,” simply takes an item and divides it by the table size, returning the remainder as its hash value (h(item)=item%11h(item)=item%11). Table 4 gives all of the hash values for our example items. Note that this remainder method (modulo arithmetic) will typically be present in some form in all hash functions, since the result must be in the range of slot names.