🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #64925

Re: [xBin] file size problem

#64925
From: Curt Welch
Date: Fri, 18 Apr 2003 19:09
48 lines
3514 bytes
"Mirco Romanato" <painlord2k@yahoo.it> wrote:
> Curt Welch wrote:
> > With xBin, the size of the entire file is going to be transmitted in
> > every article along with the data has the hash values so clients (and
> > servers) can verify the article as being valid.
>
> > The file size would be included in the Message-Id along with a partal
> > tree hash value and the offset and size of the data chunk included in
> > the article.
>
> > I had though that all this information could be proven consistent by
> > recalculating the hash using the data and partial hash tree values
> > from the ariticle.   However, this is not the case for the file size.
> > The file size can be faked, or intentionally corrupted in an effort
> > to "break" things.
>
> I researched your issue and yes is an issue.
>
> http://zgp.org/pipermail/p2p-hackers/2002-November/000997.html
> http://zgp.org/pipermail/p2p-hackers/2002-November/000998.html

Very interesting.  They are proposing the same type of fix of hashing the
size for what is actually a slightly different reason.  And the cleaner and
stronger solution is to include the size of the data you are building a
hash for at every node of the hash tree, not just the top node.

The reason being is that if the root hash is calcuated as R = H(A|B) where
A and B are the hash values of the sub nodes, and | is just concatenation,
then it's trivial to create a collision.  If you made a file which was just
the bytes A|B, that file would have the same tree hash as the larger file
which had A and B as the hash values of top nodes below the root.  So it's
trivial for anyone to create a short file which the same hash as a file
with greater than one hash block in size - but it would have a different
length.  So, if you change to a hash function of H(A|B|Length-of-data), the
problem seems to be solved.  This no doubt is also why that Merkel document
talked about using a different hash function for the leaf data blocks than
for the tree nodes by adding extra constant data to the input but including
the size seems to be stronger.  I didn't see the point before but I do now.

> You could ask to Gordon Mohr <gojomo@yahoo.com> (of Bitzi) and Justin
> Chapweske <justin@chapweske.com> (of OCN) this topic.

Thanks for the pointers.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20030418150901.155$Vx@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: <20030417190800.277$iY@newsreader.com> <2mSna.49023$iy5.1400584@twister2.libero.it>

Show Full Headers
Complete Article Headers
Message-ID: <20030418150901.155$Vx@newsreader.com>
Subject: Re: [xBin] file size problem
Date: Fri, 18 Apr 2003 19:09:01 +0000
From: curt@kcwc.com (Curt Welch)
References: <20030417190800.277$iY@newsreader.com> <2mSna.49023$iy5.1400584@twister2.libero.it>
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 0oO+SPj/RA-bEh7=H.Dp2+QIEi0x2VIFa25DCFTz_WqO0i
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: 47