🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #64800

Re: xBin library version 0.1

#64800
From: Curt Welch
Date: Wed, 09 Apr 2003 23:14
115 lines
7488 bytes
"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?

> 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.

> http://www.cs.technion.ac.il/~biham/Reports/Tiger/tiger/tiger.html (hash
> algorithm)
> http://www.open-content.net/specs/draft-jchapweske-thex-02.html (merkle
> hash tree algorithm and tree exchange specification)
>
> 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).

For example, if you want to post a file of 600 MB and use a block size of
32K, you have about 38,000 hash values in the entire hash tree.  If you
post with 600KB articles, the hash tree for only the data in the on article
is around 40 hash values.  That makes the complement tree about 37,960 hash
values.  With SHA1 hashes, that's about 750KB of hash data (in binary
form).  Posting 750KB of hash data with each 600 KB chunk of file just
won't work.  Using a tiger hash would add another 150KB of hash data to the
problem.

For the above example, the hash tree depth is about 16 so the max number of
hash values we need is roughly that plus the depth of the hash tree for the
single article (about 6), so we only need to include around 22 hash values
for each article instead of 38,000 hash values.

> 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.

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.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <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!feed1.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
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>

Show Full Headers
Complete Article Headers
Message-ID: <20030409191413.445$rS@newsreader.com>
Subject: Re: xBin library version 0.1
Date: Wed, 09 Apr 2003 23:14:13 +0000
From: curt@kcwc.com (Curt Welch)
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>
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!feed1.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com sc+Y=VmuF,YWqP1G,wp.Yw4aSll1cagUYm@syeGCQj-6s8j+
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
  %IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 114