Article View: news.software.nntp
Article #62426Re: xBin (Power-Post 2003 - requesting input from authorities..)
From: Rene
Date: Tue, 24 Dec 2002 00:56
Date: Tue, 24 Dec 2002 00:56
142 lines
8773 bytes
8773 bytes
curt@kcwc.com (Curt Welch) wrote: I see you now Curt. It just needed a more detailed description of what you exactly do with the tree. What I assumed was wrong, I did suspect you're going to do something else with the tree than what I imagined, because it simply didn't make much sense otherwise. (As I showed, once you have all the leave-hashes, you have all you ever need) You add another layer of security on top of that by distributing the hashes all over the tree. So chosing between the two proposals, I'd chose your way, because it seems far more secure that way. > Thats because you got the idea slightly wrong about how the hash tree is > used to verify the data. Yep, I thought you'd wait until you've got enough leaves to calculate the node one up. However what you really do is you validate the whole path from leave to root node up. > 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). Ha not only that. Using your system, it is not only insufficent to get a (colliding)hash which corresponds to the data, but you need to do this several times for just one part ! You'd need to provide a full faked path from the leave to the root, multiplying the effort. Although the attacker can peruse the data he already has from the already posted article(s) to recreate the path, it gets more complicated, AND he can't even fake any path, only those that run along the same paths of former (valid) parts. Which means, that on approximitly 50% of the parts he needs to create a colliding hash for the part-data AND the path nodes and for 50% he "only" needs to create a colliding hash for the part-data. Ouch ! > > 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 Actually, the number of hashes needed sending (as header data) is a function of the number of articles using your xbin. One article at least needs the hashes up the path to the root, so thats a guaranteed log2(N). Then it additionally needs some hashes if the blocks in the article "overlap" into other (sub)trees, but I think that must be less than log2(N) additional hashes (need to think it over though). I think the worst case is where the blocks overlap from the left-subtree into the right-subtree (ie, crosses the "middle") because if it stays in its subtree, then sooner or later up the path you reach a node you already have, if you pass over to the right side however, you have a full sub-tree to traverse upwards. > it allows each article to be independently verified without the need for > locating the correct external "hash article". This means news servers Yep, that's the added security I mentioned. I like that way better. > 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 True, the nodes along the tree are in memory only, while the hashes of the blocks need to be computed anyway (and they are the slow ones, due to file i/o) It *is* slower than my solution (a bit more memory, more memory traversal of the tree, more hashes to compute), but that fraction of cpu I gladly give up for a more secure model. > 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 Hm I think you don't have an accurate picture on how the hash algorithms work. Actually they work that way: You initialize an hash algorithm. This sets some internal registers to predefined values. Now you feed it some data (or none at all, that's still valid!) The hash algorithm fills its internal buffer with this data until it reaches its internal buffer size (which is 512bits / 64 bytes for SHA-1). Once it reaches this limit, it performs a set of bit operations and functions upon the input data and its internal state, which is changed through these operations. Now it repeates this step with any other full buffer you give it. Somewhen later, you stop giving it data and ask for the hash value. At this point, the algorithm likely has a somewhat filled buffer. This buffer is now filled to its limit (padded) according to some rule and then the computation step is performed one last time. Afterwards, the buffer is cleared and the algorithm gives you its internal state as the hash value. Should you decide to need another message hashed, you now NEED to reset the internal state or it would just continue from where it was. So the hash value you get is actually the internal state of the hash algorithm - which gets changed with each processing of a full 512bit buffer. At least, that's how MD4 and MD5 work, which I implemented. SHA-1 seems to work exactly the same way, from my skimming through the docs. As a result, you can feed it anything you want, including 0 bits. It will still work and it does not impose you any limit at all of what you feed to it. > 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. 2N - 1 to be exact :) And that's the total number of hashes, not the additional ones. If you have 8 nodes at the base, you'll have 7 nodes upon them, if you have 4 nodes at the base, you'll have 3 nodes ontop of them, etc... > 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. The way par files work is pure mathematics. Actually it's all matrix operations as far as I understand it. Still I'd need to read up on quite a lot of things to understand it entirely. What you propose is not mathematics. It were if you'd bring your own hash algorithm. But that's not wise, we are in the nice position that we can just take the work of the cryptographers. All you do with your system is add some data here, build up a tree, a basic memory structure for any serious programmer, and traverse it, ocassionally read or write a value to a node. Actually, reading and writing here now lead me to "see" an algorithm that should work at the edge of my mind. However, it's close to 2am now and I'm not going to try anything out right now. I'll write my thoughts down tomorrow, or the day after because tomorrow's christmas. Or today, because it already is 2am :) ...which reminds me: Merry christmas you all ! -- -------------------- http://NewsReader.Com/ -------------------- Usenet Newsgroup Service New Rate! $9.95/Month 50GB
Technical Details
Message-ID:
<20021223195619.621$Gg@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-mailReferences:
<cdda0v4h6t52ov7abf1j0qkpo843itf4se@4ax.com> <cfka0vsbjdlbdmtv2gg8qnehok033qh5f1@4ax.com> <20021223041127.986$6M_-_@newsreader.com> <1rfzsoaacf.fsf@vingodur.ifi.uio.no> <20021223150103.132$Bb@newsreader.com> <20021223185650.674$Oy@newsreader.com>Show Full Headers
Complete Article Headers
Message-ID: <20021223195619.621$Gg@newsreader.com> Subject: Re: xBin (Power-Post 2003 - requesting input from authorities..) Date: Tue, 24 Dec 2002 00:56:19 +0000 From: Rene <invalid@email.addr> References: <cdda0v4h6t52ov7abf1j0qkpo843itf4se@4ax.com> <cfka0vsbjdlbdmtv2gg8qnehok033qh5f1@4ax.com> <20021223041127.986$6M_-_@newsreader.com> <1rfzsoaacf.fsf@vingodur.ifi.uio.no> <20021223150103.132$Bb@newsreader.com> <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 Organization: NewsReader.Com Subscriber Newsgroups: news.software.nntp X-Trace: NewsReader.Com C0cx8d0WW0SUVE=,1k_Uo19w3yk6Rx+8wpY=.zb2haN3kB,Cs Lines: 141