Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Help about MDA

  1. #1
    Extreme Talker
    Join Date
    Sep 2003
    Location
    Pakistan
    Posts
    676

    Default

    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.

  2. #2

  3. #3
    Extreme Talker
    Join Date
    Sep 2003
    Location
    Pakistan
    Posts
    676

    Default

    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.

  4. #4
    Jet Set Willy
    Guest

    Default

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

  5. #5
    Extreme Talker
    Join Date
    Sep 2003
    Location
    Pakistan
    Posts
    676

    Default

    hmmm..may be. Well I knew your answer.

    I'll wait for someone else.

  6. #6
    Jet Set Willy
    Guest

    Default

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

  7. #7
    Extreme Talker
    Join Date
    Sep 2003
    Location
    Pakistan
    Posts
    676

    Default

    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[i] 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.

  8. #8
    Jet Set Willy
    Guest

    Default

    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.

  9. #9
    Extreme Talker
    Join Date
    Sep 2003
    Location
    Pakistan
    Posts
    676

    Default

    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.

  10. #10
    Jet Set Willy
    Guest

    Default

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •