Sign in to follow this  
Followers 0
ansichart

RFC 1321 - MD5 Algorithm (question)

3 posts in this topic

I was reading RFC 1321 (The MD5 Message-Digest Algorithm) and I am confused about step 2:

A 64-bit representation of b (the length of the message before the

padding bits were added) is appended to the result of the previous

step. In the unlikely event that b is greater than 2^64, then only

the low-order 64 bits of b are used. (These bits are appended as two

32-bit words and appended low-order word first in accordance with the

previous conventions.)

I understand most of it, I just don't understand what it means by low-order word first? I assume the least-significant word first.

So, for an example... let's say the original size of the message is 10 ASCII characters. Each ASCII character is 8 bits long, so that means b = 80 (80 bits long).

80(10) = 1010000(2)

And we want it in two 32-bit words.

00000000000000000000000000000000 32 0's

00000000000000000000000001010000 25 0's + 1010000

And now we append it low-order word first?

Does that mean the least significant word? In other words, would I append 00000000000000000000000001010000 first?

0

Share this post


Link to post
Share on other sites

You have it right, lower-order word first means least significant word first.

0

Share this post


Link to post
Share on other sites

Yes, I believe you have it right. I'd double check what the endian-ness of the 32 bit words should be as well, though. The wikipedia entry for MD5 has a pseudocode implementation, which might help you check any assumptions you are making.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0