Gnutella Forums  

Go Back   Gnutella Forums > Current Gnutella Client Forums > Phex (Cross-platform) > Development & Coding > Development Open Discussion
Register FAQ The Twelve Commandments Members List Calendar Arcade Find the Best VPN Today's Posts

Development Open Discussion Anything else about the Phex development


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old July 9th, 2007
Disciple
 
Join Date: February 23rd, 2006
Posts: 16
gnutella06 is flying high
Default How to verify piece of file

Hi There,

I would like to know, how is it possible to verify part of file downloaded from a host. I know, I have to use THEX (Tree Hash Exchange Format) for this purpose.
But I'm not sure how to use it.

When I get positive reply from a host to upload a file. In the reply I could see
"X-Thex-URI: /uri-res/N2X?urn:sha1:TY2462FV2IEMADVXYA52IX72H2GTA3C7;JGJO CMQ3LSZD7JS24GQHG3O3EPIQJUTV4GPUMXA"

I know the first hash value is the sha1 has of the complete file. But dont know the hash just followed by it.

How can I use this information to verify the the part of the file?

Thanks in advance,

Maxy
Reply With Quote
  #2 (permalink)  
Old July 9th, 2007
Phex Developer
 
Join Date: May 8th, 2001
Location: Stuttgart, Germany
Posts: 988
GregorK is flying high
Default

The following hash is the root TTH value of your hash tree...
Read the documents found at, to get more infos:
http://phex.svn.sourceforge.net/view...roposals/THEX/
__________________
Reply With Quote
  #3 (permalink)  
Old February 15th, 2008
Disciple
 
Join Date: February 23rd, 2006
Posts: 16
gnutella06 is flying high
Default Partial file verificatoin

Hello Group,

I have few questions with respect to partial file verification:

1) From where to request tiger hash tree? and how do I know that the host
I'm requesting from is trusted one?

2) What kind of request it should be to get tiger hash tree? is there any special way to request?

Thanks in advance,

Tehsin
Reply With Quote
  #4 (permalink)  
Old February 16th, 2008
Phex Developer
 
Join Date: May 8th, 2001
Location: Stuttgart, Germany
Posts: 988
GregorK is flying high
Default

You request the TTH from the same host that sends you the X-Thex-URI header.
The URL you use is the one provided in the X-Thex-URI header. It is a usual HTTP GET request.
You don't know if the host is trusted, you can only verify the TTH itself, if it matches the data and if other hosts would provide you the same root hash.
__________________
Reply With Quote
  #5 (permalink)  
Old February 22nd, 2008
Disciple
 
Join Date: February 23rd, 2006
Posts: 16
gnutella06 is flying high
Default

Thanks for the reply. I have few more questions. When I requested the the Tiger tree to some host
with the following request:

GET /uri-res/N2X? urn:sha1:YKOTZQMNXNBXMKEQRJCJND32F6DAEYOY;FLCSY6YP GWUW75AT3TVH3VC3YADQNZLLJTRBVKI HTTP/1.1\r\n


From some host I get malformed request reply. I dont understand, why?

When I get positive reply from some other host, I can't understand how to parse, the binary serialized
tiger tree hash, any hints would be appreciated.

Thanks in advance,

Tehsin
Reply With Quote
  #6 (permalink)  
Old February 22nd, 2008
Phex Developer
 
Join Date: May 8th, 2001
Location: Stuttgart, Germany
Posts: 988
GregorK is flying high
Default

The tree data is encapsulated in DIME payloads
SourceForge.net Repository - [phex] View of /phex/trunk/docs/Gnutella/proposals/THEX/draft-nielsen-dime-01.txt
__________________
Reply With Quote
  #7 (permalink)  
Old April 7th, 2008
Disciple
 
Join Date: February 23rd, 2006
Posts: 16
gnutella06 is flying high
Default

I have few question regarding verification process of partial files:-

1) Treenodesize, is it the chunk size of the file?

2) If yes, so I could compute leaf hash(using Tiger ) for this chunk and see if this leaf hash is present in the list of hashes which I got from the unloader?

Thanks in advance,
Reply With Quote
  #8 (permalink)  
Old September 15th, 2008
Disciple
 
Join Date: February 23rd, 2006
Posts: 16
gnutella06 is flying high
Default

I was trying to compute leaf hashes. To compute leaf hash, the chunk of file is prefixed with '0' and then compute tiger hash of it. Unfortunately, it doesn't work, when I compared what I was getting from Gnutella network.

I would like to know how exactly leaf hashed is computed? Although I'm not so good with Java, I tried to see Phex code and could see that there is some special way to compute leaf hash. The only thing which I understood is, the leaf hash is computed by computing hash of each 1kb. I don't understand how exactly the leaf hash computed.

Any help would be greatly appreciated.
Reply With Quote
  #9 (permalink)  
Old October 20th, 2009
Apprentice
 
Join Date: February 18th, 2006
Posts: 9
CyberBob is flying high
Default

Quote:
Originally Posted by gnutella06 View Post
Thanks for the reply. I have few more questions. When I requested the the Tiger tree to some host
with the following request:

GET /uri-res/N2X? urn:sha1:YKOTZQMNXNBXMKEQRJCJND32F6DAEYOY;FLCSY6YP GWUW75AT3TVH3VC3YADQNZLLJTRBVKI HTTP/1.1\r\n


From some host I get malformed request reply. I dont understand, why?

When I get positive reply from some other host, I can't understand how to parse, the binary serialized
tiger tree hash, any hints would be appreciated.

Thanks in advance,

Tehsin

sorry for replying this late. anyway, you may have idea already but .....

you do not request like this:
Code:
GET /uri-res/N2X? urn:sha1:YKOTZQMNXNBXMKEQRJCJND32F6DAEYOY;FLCSY6YPGWUW75AT3TVH3VC3YADQNZLLJTRBVKI HTTP/1.1\r\n
but you do request with this:
Code:
GET /uri-res/N2X? urn:sha1:YKOTZQMNXNBXMKEQRJCJND32F6DAEYOY HTTP/1.1\r\n
string after semi-colon is TTH value which you need to verify against received DIME message, but you do not use that part for requesting.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to verify file before it is completel finished judyduck Download/Upload Problems 1 June 5th, 2005 08:57 AM
Verify file contents problem grassy Download/Upload Problems 1 May 28th, 2005 02:07 AM
Failed to verify signature of .msi file I AM NOT REGISTERED! Windows 0 June 1st, 2003 11:58 PM
Error 1621 Failed to verify signature of file isscript.msi No registerr Windows 0 February 9th, 2003 07:09 PM
1621: failed to verify signature of file Unregistered Windows 1 July 14th, 2002 12:46 AM


All times are GMT -7. The time now is 01:24 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.