Hash files, Question by calculation
|
|
![]() ![]() ![]() |
Hash files, Question by calculation
| Girder |
Jan 19 2004, 12:50
|
|
Group: Members Posts: 12 Joined: 28-October 03 |
How pays off Hash a file and its parts?
Very much I ask to show as formulas (Or a code on Delphi). Beforehand thanks. |
|
Post
#1
|
|
| Fuxie - DK |
Jan 19 2004, 13:05
|
|
Group: Managers Posts: 4800 Joined: 21-January 03 From: Copenhagen, Denmark |
Can you please explain what you mean?
It makes no sense to me at all... |
|
Post
#2
|
|
| reanimated838uk |
Jan 19 2004, 13:10
|
|
Nutcracker Group: Betatesters Posts: 5198 Joined: 1-March 03 From: UK |
He wants to know how the hash id for files are calculated so he can show it as a formula or code it in it.
I think it uses MD4 Hashing, though not sure how it does this. I think emule-official has it in its FAQ/Help, but im not sure. |
|
Post
#3
|
|
| Fuxie - DK |
Jan 19 2004, 13:26
|
|
Group: Managers Posts: 4800 Joined: 21-January 03 From: Copenhagen, Denmark |
Well... That wasn't very clear..
|
|
Post
#4
|
|
| Girder |
Jan 19 2004, 13:27
|
||
|
Group: Members Posts: 12 Joined: 28-October 03 |
- You are right. If briefly: the algorithm of calculation Interests. Everywhere searched, climbed in source codes. With С++ badly I understand. Can experts from a forum will help. |
||
|
Post
#5
|
|||
| morevit |
Jan 19 2004, 13:43
|
||
|
Group: Retired Devs Posts: 1066 Joined: 10-September 03 From: US East Coast |
Here it is...
I don't pretend to understand completely what's going on, but essentially, the hash is initialized to some magic value and then the data is eaten 64 bytes at a time, put through the MD4 transform, and added to the hash. The MD4 transform is the actual hash. It tries to create a reasonably unique 16 byte value from the next 64 bytes of data. There's a little complication at the end because the data isn't usually an even multiple of 64 bytes long. Hope that helps. |
||
|
Post
#6
|
|||
| moosetea |
Jan 19 2004, 13:54
|
|
Group: Retired Devs Posts: 803 Joined: 7-February 03 |
It uses MD4 hashing.....
Each Part (9mb or so) is hashed using md4 to produce the part hash, then all the part hashes are hashed together to produce the overall filehash. The filehash is contained in the e2k link, all the hashes of the parts (known as a hashset) is transfered p2p between two clients, when you find a source for this file In this way we can validate each part as correct, as all clients have a hashset. When we download a complete part it is hashed, if it matches the part hash in the hashset it is correct and will be uploaded to other clients. If it is invalid, the part is dropped or a fix is attempted. |
|
Post
#7
|
|
| KuSh |
Jan 19 2004, 13:55
|
|
Group: Developers Posts: 1182 Joined: 15-December 03 |
it is just a MD4 hash function on the all file ...
magic value and additions you're talking about are part of the MD4 algorithm try to search the web on hashing functions (google rocks) ... i'm not an expert in english to be able to explain you precisely how it works and for what it is used KuSh |
|
Post
#8
|
|
| morevit |
Jan 19 2004, 13:56
|
|
Group: Retired Devs Posts: 1066 Joined: 10-September 03 From: US East Coast |
He was asking to see the actual hashing algorithm moose.
|
|
Post
#9
|
|
| morevit |
Jan 19 2004, 13:57
|
||
|
Group: Retired Devs Posts: 1066 Joined: 10-September 03 From: US East Coast |
Saying "MD4 MD4" doesn't explain anything. |
||
|
Post
#10
|
|||
| moosetea |
Jan 19 2004, 13:58
|
|
Group: Retired Devs Posts: 803 Joined: 7-February 03 |
well its not that complicated as long as you know the theory. You can put together a filehasher in only few lines of vb.net code (if you have the c# md4 library/class).
The md4 RFC, if you want to know how MD4 works http://community.roxen.com/developers/idocs/rfc/rfc1320.html This post has been edited by moosetea: Jan 19 2004, 14:02 |
|
Post
#11
|
|
| reanimated838uk |
Jan 19 2004, 14:10
|
|
Nutcracker Group: Betatesters Posts: 5198 Joined: 1-March 03 From: UK |
Is that MD4 Optimisation code by Aw3 related to this hashing?... because ive noticed the hashing for RC2 is a lot smoother and less demanding than previous versions and was wondering if it was related to that.
|
|
Post
#12
|
|
| KuSh |
Jan 19 2004, 14:13
|
||||
|
Group: Developers Posts: 1182 Joined: 15-December 03 |
i know that sayin' "MD4 MD4" (and i'm not sure it was exactly what i've said i've just talled him to search the web with keywords cause i'm not able (due to my foreign language difficiculties) to explain correctly what i want to explain ... sorry for the uneeded posts ... will try to do my best
yup they're related !!! KuSh This post has been edited by KuSh: Jan 19 2004, 14:16 |
||||
|
Post
#13
|
|||||
| reanimated838uk |
Jan 19 2004, 14:19
|
|
Nutcracker Group: Betatesters Posts: 5198 Joined: 1-March 03 From: UK |
Morevit isnt saying you said "MD4 MD4" exactly, he just means bringing its name up a lot of times but not actually going through its code process.
I don't understand it too but mainly because my code skills really suck |
|
Post
#14
|
|
| moosetea |
Jan 19 2004, 14:31
|
|
Group: Retired Devs Posts: 803 Joined: 7-February 03 |
Hmm but Md4, Md4 is about right ;P. An edonkey hash is the Md4 of all the parts. nb this hashes are theortical and not valid but essentially
Calculate all the part md4s (the hashset) Md4(Part1) == 1FFFFFFFFFFFFFFF Md4(Part2) == 2FFFFFFFFFFFFFFF Md4(Part3) == 3FFFFFFFFFFFFFFF Md4(1FFFFFFFFFFFFFF2FFFFFFFFFFFFFFF3FFFFFFFFFFFFFFFF) = File hash (ie 123FFFFFFFFFFFFF) yeah the recent change is to do with hashing speed. I believe the change only works on smaller data, and as we only ever hash 9 or so mb at a time we get a big performance boost by changing some maths. This post has been edited by moosetea: Jan 19 2004, 14:36 |
|
Post
#15
|
|
![]() ![]() ![]() |
| Lo-Fi Version | Time is now: 21st May 2013 - 14:18 |