I am just having one problem in my understanding of the MD5 hash
//Pre-processing:
append "1" bit to message
append "0" bits until message length in bits ≡ 448 (mod 512)
append bit /* bit (not byte) length of unpadded message as 64-bit little-endian integer */ to message
Does this step mean append a 1 on the right side or left side of my message.
For example if my message was
10100010101010111010101 does it become
110100010101010111010101 or 101000101010101110101011
And after that do I pad with zeros on the right or left of the one.
example
100000000000000...my message ... followed by 64 bit length in little endian of my message
or my message ... 100000000000000.... followed by 64 bit length in little endian of my message
Thanks for any help on this.
MD5 hash ?
Re: MD5 hash ?
As far as I understand it, with MD5 padding (which is the same as MD4 padding) you add a 1 and the 0's to the end of the message
If you're interested in implementing security, I'd highly recommend reading 'Network Security, private communication in a public world, 2nd ed', by Kaufman, Perlman and Speciner.
Pages 133 and 136 have the information you need on MD4 and MD5 hashes.
It would be the second one.Does this step mean append a 1 on the right side or left side of my message.
For example if my message was
10100010101010111010101 does it become
110100010101010111010101 or 101000101010101110101011
If you're interested in implementing security, I'd highly recommend reading 'Network Security, private communication in a public world, 2nd ed', by Kaufman, Perlman and Speciner.
Pages 133 and 136 have the information you need on MD4 and MD5 hashes.
Re: MD5 hash ?
It's on wikipedia and the specs. To make it simple for you:
You're most likely going to work on byte arrays, not bit streams.
Just add 0x80, fill the rest with zero, then cast the last part to uint64_t and set it to byte length * 8. You'd need some converting if not on little endian.
You're most likely going to work on byte arrays, not bit streams.
Just add 0x80, fill the rest with zero, then cast the last part to uint64_t and set it to byte length * 8. You'd need some converting if not on little endian.