1
$\begingroup$

So I need to to illustrate Davies-Meyer hash function for a message “123” with 1-byte blocks. I can use the extended ASCII representation where each character is represented as a byte. And I can pick the initial value of hash H0 as all zeros.

So far I've padded the message, but now I'm stuck and don't understand where to go from here. Here is what I have so far...

x = 123

l = 24 bits or 11000

[0000 0001][0000 0010][0000 0011][1][0000…0][0000…0001 1000]

The first block is "1", the second is "2", the third is "3", the fourth is the appended "1", the fifth and so on is 423 zeros, and the last block is the length of 24 bits, totaling 512 bits.

Now I'm thinking I gotta divide the 512 bit block into 16 words of size 32 bits. But I'm not sure how to do that or hot to apply the Davies-Meyer hash function to it.

$\endgroup$
1
$\begingroup$

Davies-Meyer is a compression function construction. You need to call a block cipher with your to-be-hashed data as the key and the chaining value as the plaintext. You then XOR the plaintext to the output of the block cipher call to obtain the next chaining value.

$\endgroup$
  • $\begingroup$ Okay I think I got it. So, if 1(ASCII) = 32(Hex) = 0011 0001 (Binary), then... H1 = H0 xor (0011 0001 * H0). My only question is how do you compute "(0011 0001 * H0)"? Is it an xor? $\endgroup$ – Bob Albret Nov 6 '14 at 16:33
  • $\begingroup$ I don't understand what you're asking $\endgroup$ – Martin M. Lauridsen Feb 12 '16 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.