Help about MDA

M.H.A.Q.S.

New member
I have a subject of Data Security and Encryptography in this semester and after some days I have to give a presentation on a topic entitled "MDA : Message Digest Algorithms".

I have studied the topic but still the MD5 algorithm is difficult to understand. I know how the SHA-1 algorithm works because I studied that while looking into the MAME sources.

Does anybody know of the MD5 algo.
 

M.H.A.Q.S.

New member
Thanks Waz..but I have both of those. If you follow the 2nd link, it has the complete MD5 algo.

The steps in the text file, on how does the algo work are confusing.

If you understand the algo, can you explain it a bit.
 
J

Jet Set Willy

Guest
I'm not working through all of that when I don't need to know it myself.
 
J

Jet Set Willy

Guest
Well, how far can you get before you get stuck? Maybe I can help you out with bits of it.
 

M.H.A.Q.S.

New member
hmmm...If you have the 1321.txt document.

When you reach step 4 of section 3.4 where it says

This step uses a 64-element table T[1 ... 64] constructed from the
sine function. Let T denote the i-th element of the table, which
is equal to the integer part of 4294967296 times abs(sin(i)), where i
is in radians. The elements of the table are given in the appendix.


I understand the table stuff and how it builds up. The problem is when you proceed further into the step.
 
J

Jet Set Willy

Guest
An element i is equal to 4294967296*abs( sin(i) ).

abs is the "absolute" function. It just means that if the result of sin is negative, it will turn it positive. It's the same as the mathematical operator "modulos", i.e. |-4| = 4

So, the table would look like this:

int table[64];

[0]=4294967296*abs( sin(1) )=3614090360
[1]=4294967296*abs( sin(2) )=3905402710
[2]=4294967296*abs( sin(3) )=606105819
[3]=4294967296*abs( sin(4) )=3250441966
....
[63]=4294967296*abs( sin(64) )=3250441966

You can confirm that this is the correct approach by Googling for some of the values I've generated. The results bring up MD5 documentation. :)

Hope that helps. I can write you some C source code to generate the table if that would help.
 

M.H.A.Q.S.

New member
hmmm I understand what you said Waz. Great!

C, well I have implemented 50% of the algorithm myself. But the problem was here when I had to implement the table.

The explanation was a help.

Ok one more thing. Waz, what would be the way if I want to either optimize the way this algo produces the Hashes or Digests of a message.

If so, can I increase the length of the message from a standard 128 bit Hash to 256 or higher.

And one more thing, my side of the code is toooo slow.

I know I'm asking you alot of things at the same time. Hope you have the time.
 
J

Jet Set Willy

Guest
It's okay. I'm quite enjoying this, it's new territory.

I'm not at all familiar with the algorithm, so I won't be much help on specific matters. What datatype are you using for 128 bit tables? I imagine you're using arrays of four 32 bit values to combine and act as 128 bit values?

As for speeding up your code, I don't know how to help without actually seeing it. I have seen a file called md5.c around on the Web however. You might be able to look at that and compare it with your own code.

Good luck.
 

M.H.A.Q.S.

New member
Yes, the word datatype is of 32bits and byte of 8bits.

I'll complete the code in a few hours. It is taking me more time than necessary because my monitor got wrecked up.

I have to increase the complexity of the algo from 128bits to at least 16+ bits.

I'm searching for help on that. Thanks for the md5.c link. I have found the problem with my algo.

Keep it coming Waz. I'll come back to this topic.
 

M.H.A.Q.S.

New member
OK Waz, you were a good help (morally too). I reduced the time by getting rid of the loops and now I have another task.

I have to do it in inverted tables. Now the fun comes. I hope I will get it.

Do you think it is possible to get it done in inversion.
 
J

Jet Set Willy

Guest
Not that I know of. I may know them under a different terminology though.
 
J

Jet Set Willy

Guest
No, I've not done any computer related course, I just know how to work things out.
 

M.H.A.Q.S.

New member
Great...OK, than i probably have to tell you about things on a lower level.

See..Inverted tables like arrays connected to each other through some index tables that help as keys to the original tables.

The use of having these tables is that you don't have to change the original data to get a sorted form, just changing the index to key tables helps you out.

So inverted tables are those tables that have there index tables inverted. If you invert an index table the outlook of the original table appears to be inverted as well, which infact isn't.

So is it okay for you or am I going to need someone else's help on this.
 
J

Jet Set Willy

Guest
Are you talking about hashing?

Don't assume that you have to talk about things on a lower level just because I haven't been on a specific course. Some people are able to teach theirselves better than a course.
 

M.H.A.Q.S.

New member
Hasing is a different technique...although it uses arrays but you can not call them the same.

Hashing is an encryption technique where as Tables are used to maintain and sort data.

A typical example would be a telephone directory, where you want to sort out two tables on teh basis of a "name" but you just want to do that to show it to the user and changing the original data.

I am about to merge the two techniques...using hashing in the algorithm and storing data in tables.
 
Top