[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Mldonkey-users] Re: wrong md4 digest
From: |
Robin Hill |
Subject: |
[Mldonkey-users] Re: wrong md4 digest |
Date: |
Sun, 8 Dec 2002 14:34:18 +0000 |
User-agent: |
Mutt/1.4i |
On Sun Dec 08, 2002 at 11:31:57AM -0200, unixach <address@hidden> wrote:
> I was playing with openssl dgst -md4 to create a script which echoes a
> ed2k:// link to the screen. It seemed to work (I compared the MD4 generated
> by openssl with the one generated by ed2k_hash). But only for some files. For
> "big" files, the MD4 differs.
>
Yes, edonkey hashes aren't straight MD4 hashes. What it does is split
the file into 9M chunks and calculate an MD4 hash for each chunk. These
hashes are put, consecutively, into a buffer and an MD4 hash is created
for this buffer. This final hash is the one used by edonkey. This
means that for small files (under 9M) a straight MD4 will get you the
same result but for > 9M files it won't.
I assume the reason for doing it this way is that edonkey works using
these 9M chunks for verification, etc (if you look in the
shared_files.ini for mldonkey you'll see the MD4 hashes for each chunk)
so it has to calculate the hashes for each block as it downloads. It's
a lot quicker then to generate an overall hash from these rather than
having to go through the entire file again.
HTH,
Robin
--
___
( ' } | Robin Hill <address@hidden> |
/ / ) | Little Jim says .... |
// !! | "He fallen in de water !!" |