🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #62421

Re: xBin (Power-Post 2003 - requesting input from authorities..)

#62421
From: Curt Welch
Date: Mon, 23 Dec 2002 23:56
114 lines
7056 bytes
Rene <invalid@email.addr> wrote:
> Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> wrote:
> > let me see if I understand you correctly.  let's say it's a 13 part
> > posting.
>
> I imagined it the same way from Curt's description. Thanks for the nice
> ASCII (I just hope it survives my quoting)
>
> >
> >                               l
> >                 +----------------------------+
> >                 j                            k
> >         +--------------+                +---------+
> >         |              |                |         |
> >         g              h                i         |
> >     +------+        +------+        +------+      |
> >     |      |        |      |        |      |      |
> >     a      b        c      d        e      f      |
> >   +--+    +--+    +--+    +--+    +--+    +--+    |
> >   |  |    |  |    |  |    |  |    |  |    |  |    |
> >   1  2    3  4    5  6    7  8    9 10   11  12  13
> >
> > "1" is the hash of part 1, "a" is the result of hashing the
> > concatenation of "01" and "02", "g" is the result of hashing the
> > concatenation of "a" and "b", and so on.
> > part 1 should include its own hash, as well as a, g, j, and l.
> > part 4 should include its own hash, as well as b, g, j, and l.
> > part 13 should include its own hash, as well as k and l.
>
> I exactly looked at it this way too. However, if that is how it is
> intended, then what happens if I manipulate, say part 3?

Thats because you got the idea slightly wrong about how the hash tree is
used to verify the data.

If you send out a bogus part 3, the newsreader will try to use your bogus
data to recalcuate the tree-hash of the file.  If you supply bogus data,
the tree hash will be wrong, so the article will be rejected.  Trying to
supply data which correctly hashses to the right value is too hard to be
worth the trouble (if it's even possible in our life times).

> > the assembly program can notice discrepancies both by comparing hashes
> > (the "g" of 1 should be equal the "g" of "4"), and by verifying that
> > the hashes are correct (the hash of "a" from 1 and "b" from 4 should
> > equal the "g" found in either).
>
> True, but is this really necessary? Consider the following: A file is to
> be transported using this system (without hash trees):
>
> The file again has 13 parts, 1..13 (or 0..12, if you must), whereas part
> means block size with regard to the hashing algorithm. So we get 13
> hashes, the hashes 1..13. Now we take these 13 hashes and put them again
> into the hash algorithm. We get hash "l", the file hash. We can now
> safely publish the thirteen hashes, because everyone can validate them.
> The thirteen hashes, put into the hash-algorithm must equal l, the file
> hash.
>
> Having the file hash AND the thirtheen hashes is all we need. Because an
> attacker now cannot change the "leave-hashes", because that would be
> easily spottable. He also cannot inject bogus parts, because they can now
> be detected as such.

No you are catching on to how it works.

> There's no hash-tree and no overhead of calculating one, nor a need to
> validate the inner nodes (hash keys a..g). Of course if someone finds
> another message, giving the same hash code, then the system fails. But
> its the hash algorithm that failed in that case, so choosing a good one
> seems paramount to me.
>
> Maybe I'm just not seeing what is intended with the tree. The solution I
> propose here just needs a good way to distribute those basic
> block-hashes.

The tree hash is an improved version of the system you just proposed.  For
your system, a 100MB file with a 4K hash block would require you to publish
a hash article with 25,000 hash values. With the tree hash, you only have
to distibute log2(25,000)+log2(partsize) hash values with each article.
For a 100K part size, that works out to 15 + 5 or 20 hash values (worst
case) with each article.

The total number of hash values published would then be 20,000 (1000 parts
with approximately 20 hash values each), so the space wasted is not much
different for that example.  But the beauty of the hash tree is that it
allows each article to be independently verified without the need for
locating the correct external "hash article".  This means news servers can
verify a post when it's posted, without storing the "hash file" somewhere
for reference.  And the news server can reject it to prevent the forgery or
the corrupted article, from being sent out to usenet.  You just can do
stuff like that without using the hash tree.

Computationally, the hash tree does not require any significant more CPU or
memory to calculate than a straight hash of the the same file.  To calacute
an SHA-1 hash of a 20MB file, the SHA-1 code has to calculate 1 million
hash values on the 20 byte SHA-1 hash blocks.  To calcuate the tree hash
using 4K hash blocks on the same file, you have to calcuate an additional
2N more 20 byte hash blocks where N is the number of blocks.  For a 4K
block size that's 10,000 more hash calculations bringing the total to 1,
010,000 calcuations for the tree-hash instead of just 1,000,000 which is
the amount of work to do a straight SHA-1. (1% more cpu work).

Extra storage for calculating the tree hash is log2(N) or 13*20 byte hash
values (an extra 260 bytes of memory).

The tree-hash is without question the better answer to this problem.  It's
just a bit complex and usenet doesn't always do well with "complex".

But par files are beyond the understanding of most usenet programmers as
well, yet they have found a place in usenet.  So I have hope.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20021223185650.674$Oy@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!feed3.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <cdda0v4h6t52ov7abf1j0qkpo843itf4se@4ax.com> <cfka0vsbjdlbdmtv2gg8qnehok033qh5f1@4ax.com> <20021223041127.986$6M_-_@newsreader.com> <1rfzsoaacf.fsf@vingodur.ifi.uio.no> <20021223150103.132$Bb@newsreader.com>

Show Full Headers
Complete Article Headers
Message-ID: <20021223185650.674$Oy@newsreader.com>
Subject: Re: xBin (Power-Post 2003 - requesting input from authorities..)
Date: Mon, 23 Dec 2002 23:56:50 +0000
From: curt@kcwc.com (Curt Welch)
References: <cdda0v4h6t52ov7abf1j0qkpo843itf4se@4ax.com> <cfka0vsbjdlbdmtv2gg8qnehok033qh5f1@4ax.com> <20021223041127.986$6M_-_@newsreader.com> <1rfzsoaacf.fsf@vingodur.ifi.uio.no> <20021223150103.132$Bb@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!feed3.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com qBJ_TDOf0CCp=yV38keGErMLITNqwERk+CjJ,sRh2haN3ydSoF
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: 113