Article View: news.software.nntp
Article #64822Re: xBin library version 0.1
From: Chris AtLee
Date: Thu, 10 Apr 2003 18:15
Date: Thu, 10 Apr 2003 18:15
151 lines
9320 bytes
9320 bytes
On Wed, 09 Apr 2003 23:14:13 +0000, Curt Welch wrote: > "Chris AtLee" <catlee@canada.com> wrote: >> Just finished reading some of the documentation on Tiger Tree Hashes, >> and it looks like they're exactly what xBin does with SHA1 hashes, >> except with a different hashing algorithm. > > Yes, they are. TigerTree uses 1K blocks with the 192 bit Tiger hash. > >> They also include an extra byte of >> input when combining internal nodes in the tree (in order to protect >> against collisions). > > ??? what are you talking about? I haven't seen anything like that in > the definitions I've read. Where does the extra byte come from? From the Tree Hash Exchange Format document section 2.1: http://www.open-content.net/specs/draft-jchapweske-thex-02.html#anchor3 "In order to protect against collisions between leaf hashes and internal hashes, different hash constructs are used to hash the leaf nodes and the internal nodes. The same hash algorithm is used as the basis of each construct, but a single '1' byte in network byte order, or 0x01 is prepended to the input of the internal node hashes, and a single '0' byte, or 0x00 is prepended to the input of the leaf node hashes. Let H() be the secure hash algorithm, for example SHA-1. internal hash function = IH(X) = H(0x01, X) leaf hash function = LH(X) = H(0x00, X)" I haven't checked the source to see if tigertree hashes actually use this or not, but this is where I got it from. >> The docs also mention that the name for this type of tree is a Merkle >> Hash Tree. > > Right. > >> The stated advantages of the Tiger hash over the SHA1 hash are that it >> is equal to the SHA1 hash on a 32bit processor in terms of speed, and >> can be faster on 16bit or 64bit platforms. The Tiger hash produces 192 >> bits of output, but they claim that even a truncated 160 bit version is >> more secure than a SHA1 hash. > > xBin is _not_ a "security" application. SHA1 is many orders of > magnatude more "secure" than is already needed for this application. > Even if a weakness or collision is found in SHA1 at some point in the > future, it will not prevent it from continuing to be used in xBin on > Usenet for years and years. This is because data posted to Usenet will > normally have a short live-span, and a very low "value". Even with a > "weak" hash algortihgm, the cost of producing a forged article which > will trick the system will remain high for many years. Is it worth > setting up a distribted network of 1000 machines and crunching for a few > months just to be able to create a single collsion to corrupt a single > usenet file post? If someone has to work that hard in order to post a > single forged segment for a single usenet file, is it really going to > cause any problems large enough to care about for Usenet? > > And the issue with speed is a non issue for this applicaiton. The > limiting factor by a few orders of magnature is not CPU speed but disk > and network speed. SHA1 is already something like 100 times faster than > it needs to be in order to calculate the hash of a large file stored on > a disk. The CPU is mostly sitting idle wating for the disk to deliver > the next block. There is nothing useful gained by switching to a > "faster" hash algorithm. > > A hash alogirthm with more bits however does waste more bandwidth and > disk space when you try to transmit and store these hash trees. The point they were claiming in the Tiger hash document was that even if you only used 160 bits of the Tiger hash, those 160 bits were a stronger hash than the 160 SHA1 bits, so if bandwidth was an issue, you could just send 160 bits. Anyway, I'm not advocating Tiger over SHA1, I was just summarizing the differences. >> They recommend a block size of 1,024 bytes, but the algorithm will work >> with any size you want. There is no mention of only including the >> complement of the hash tree with the data portion, it looks like they >> recommend to include the entire hash tree with every portion of data. > > xBin doesn't include the complement, it includes much less than that. It > includes only the top level edge nodes from the complement. Including > the entire complement would be useful, but it's a hell of a lot more > data and just can't be justified for this application. You only need to > include enough of the hash tree to allow you to re-compute to file hash > if your goal is to verify the data in the article (which is the point of > all this). Sorry, that is what I meant. I didn't know what to call it, so I called it the complement. Maybe minimal hash tree complement would be more accurate? >> So basically, in order to get an xBin post compatible with these P2P >> networks, the hashing algorithm used would need to be slightly >> different, would have to include the SHA1 hash of the entire file, and >> possibly change the block sized used. > > Switching to a tree hash which matches multple P2P networks can be of > value. But so far, from what I've seen, there really isn't a standard > there. Each network that has used hash trees seem to have picked a > different standard. Maybe they should change to match xBin? :) > > There is also a hash standard called "bitprint" (if I remeber correctly) > which was created for use in P2P networks. It seems to be a standard > without a home (much like xBin). If I remeber, it's a tiger hash > combined with an SHA1 hash. This ends up creating a "huge" (192+120 > bit) file hash used to identify files. Only the tiger-hash part would > be useful in veryifying file segments. Yes, the bitprint is a combination of the SHA1 hash with the TigerTree hash of a file (which is different from a tiger hash of a file - a tiger tree hashes combines tiger hashes of 1024 bytes into a merkle hash tree; the tiger hash itself knows nothing about trees, so it could be used on the entire file) > I really don't know much about the state of P2P networks, so I'm game to > hear more about it. I don't think there's a lot of value trying to tie > the P2P network into Usenet in any automated fashion - and there are > many dangers in any approach that does that. But, there are other good > reasons for sharing a common "file ID" system between usenet and other > networks. It means for example that a web site which lists files posted > to Usenet and/or P2P networks can use the same file-id to identify the > file. This allows the web site to automatically identify files posted > to both places so it can let people know that the same file can be found > on both networks. There would be a lot of advantage for users to have > access to tools which could download part of a file from Usenet, and the > rest from some P2P network. Or, to just use the P2P network to repost > missing parts assumming the P2P nework is smart enough to support > partial file posts and fetches. This is what caught my attention. Sharing common "file ID"s between usenet and other networks opens up a lot of possibilities. In addition, there are tools out there that let you associate meta-data with file IDs (see the bitcollider utility at www.bitzi.com) Having your P2P client scan various newsgroups for files and use usenet to request and repost missing parts is a very powerful idea. Of course, the P2P side would need to add on something to specify which newsgroups the files were being posted in. If this makes sense to include into xBin, it would mean changing the block size to 1,024 bytes, using the TigerTree hash for verification of blocks, and also including the SHA1 hash in the headers somewhere. All of this means that the xBin headers will be slightly larger since the TigerTree hash is longer and minimal hash tree complement will be larger since the merkle hash tree is larger. Cheers, Chris
Technical Details
Message-ID:
<pan.2003.04.10.18.15.24.309042@canada.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!sjc70.webusenet.com!news.webusenet.com!news03.bloor.is.net.cable.rogers.com!news04.bloor.is.net.cable.rogers.com.POSTED!not-for-mailReferences:
<pan.2003.04.08.05.21.36.142899@canada.com> <l_Cka.19193$iy5.537691@twister2.libero.it> <pan.2003.04.08.17.40.39.978437@canada.com> <pan.2003.04.08.18.19.33.288947@canada.com> <20030409191413.445$rS@newsreader.com>Show Full Headers
Complete Article Headers
Message-ID: <pan.2003.04.10.18.15.24.309042@canada.com> Subject: Re: xBin library version 0.1 Date: Thu, 10 Apr 2003 18:15:25 GMT From: "Chris AtLee" <catlee@canada.com> References: <pan.2003.04.08.05.21.36.142899@canada.com> <l_Cka.19193$iy5.537691@twister2.libero.it> <pan.2003.04.08.17.40.39.978437@canada.com> <pan.2003.04.08.18.19.33.288947@canada.com> <20030409191413.445$rS@newsreader.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!sjc70.webusenet.com!news.webusenet.com!news03.bloor.is.net.cable.rogers.com!news04.bloor.is.net.cable.rogers.com.POSTED!not-for-mail User-Agent: Pan/0.13.4 (She had eyes like strange sins. (Debian GNU/Linux)) Newsgroups: news.software.nntp MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Lines: 150 NNTP-Posting-Host: 24.114.32.59 X-Complaints-To: abuse@rogers.com X-Trace: news04.bloor.is.net.cable.rogers.com 1049998525 24.114.32.59 (Thu, 10 Apr 2003 14:15:25 EDT) NNTP-Posting-Date: Thu, 10 Apr 2003 14:15:25 EDT