🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #61284

Re: [FNTP] verifying that part reposts belong to a file - solution

#61284
From: Brian Truitt
Date: Thu, 10 Oct 2002 18:52
96 lines
5439 bytes
"Curt Welch" <curt@kcwc.com> wrote in message
news:20021010014047.034$XV@newsreader.com...
> I'm only a bit concernted that if you only hash two values to get one,
that
> it won't be as secure as if you were to hash more at each level of the
> tree.

I think you wouldn't have a problem, as long as the hash function itself was
strong. If I take 2 hashes, put them together somehow, and put it thru the
hash function to get a new hash, if you have one original hash and the final
hash you would still have to brute force thru all the possible values of the
second hash and see if it results in the final hash. If not, the hashing
function is flawed to begin with for security use and should be thrown away.

> I don't know why you say "repost".  I'm thinking of this for all binary
> posts on usenet, not just "reposts".  And yes, all the segments would
> have to begin and end on these hash chunk boundries.  So the amount
> of data in each file will have to be an integer multiple of the
> chunk size.
>
> This means the chunk size should not be very large so when you split a
> file up, you can still attempt to make all the parts somewhat close to
> each other.  I'm still thinking something in the 1K size is about
> right.
>

I disagree with this. Picking a small chunk size is going to create a huge
amount of calculation for each part you post. Simplist case, your post size
is 512K, your chunk size is 256K. You calculate hash A and B on the 2
chunks, then calculate hash C from the somehow combined hashes A and B. Hash
C would be your top hash. Hash C is NOT the same as taking a hash of the
entire 512K part. So now we reduce the chunk size to 128K. Now we do a hash
on 4 chunks, then 2 combine hashes, then a final combine hash. So now you
have 7 hashes per post to work out. If you take this down to 64 byte chunks,
you now have to calculate 16383 hashes per 512k post. At 1024 byte chunks,
you still have 1023 hashes to grind thru before you get the top hash for
that post.

I think that the chunk size should be the lowest part size you should expect
someone to post at. Make it 64K, binaries shouldn't ever be split into
pieces smaller than this, and at 512k part sizes, it only requires 8 hash
calculations per post.

[snip]
> > The trick is to find a good size for P, so hash calculations
> > are kept to a minimum, and so waste is also kept to a minimum.
> > (read, minimum = acceptable levels)
>
> There will be no waste to worry about if all posts are done like this.
But
> you want the granularity low enough so all the posts come out to be about
> the same size when the article size is chosen (which helps the articles
> move at the same speed though usenet so they show up closer to the same
> time and expire closer to the same time on servers).
>
> The larger the P size, the smaller the hash tree, but doubling the size of
> P only cuts the number of hash values by 1, so I suspect it's not going to
> make much difference.
>
> Ok, so to test a value, if P is 1KB, and we want to post a 128GB file in
> chunks of 128KB each (trying to create a worse case example of a huge file
> and small part size)... (this is a 1 million part post - that would be fun
> to see).
>
> The file is 2^37 bytes long.  1K is 2^10, so that gives us 2^27 P blocks
in

This would be 2^28-1 hashes you would have to calculate. If you can
calculate 10K hashes a second, this will take you 7 hours of math to start
posting. It'll solve the bandwidth problems nicely :D

[snip]
> And, since this hash system forces all file segments to be aligned on
> blocks of size P (1K in my example), if we put the offset and segment size
> in the message-Id like we have talked about, we can now do it in units of
> size P - i.e. 1K blocks - which cuts out 10 bits from each of those
numbers
> to help (a little bit) make up for how large the Message-Id is going to
get
> for these things.

This is a good idea, the offset and size can be in counts of P segments,
which will reduce the message-id be a bit. Making P=64K strips 2 bytes off
the offset and another 2 off the size.

>
> I think these ideas are just getting better and better.  I'm beginning to
> feel the need to write proof of concept code....

I started playing around with this too, which is how I noticed how many
actual hashes you'd have to calculate per post.



Technical Details
Message-ID: <ao4htp$rq1$1@bob.news.rcn.net>
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!feed2.news.rcn.net!feed1.news.rcn.net!rcn!not-for-mail
References: <hpk9quk1cq0ti2reeu03epd0tgf4b8a8p0@4ax.com> <20021010014047.034$XV@newsreader.com>

Show Full Headers
Complete Article Headers
Message-ID: <ao4htp$rq1$1@bob.news.rcn.net>
Subject: Re: [FNTP] verifying that part reposts belong to a file - solution
Date: Thu, 10 Oct 2002 14:52:24 -0400
From: "Brian Truitt" <btruitt@rcn.com>
References: <hpk9quk1cq0ti2reeu03epd0tgf4b8a8p0@4ax.com> <20021010014047.034$XV@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!feed2.news.rcn.net!feed1.news.rcn.net!rcn!not-for-mail
Newsgroups: news.software.nntp
Lines: 95
X-Trace: UmFuZG9tSVaLlDgl5zIHNlF1rqzKIGM908kQ9mUi9YOLkuUP9GqdEH7EKcBwNa15
X-Complaints-To: abuse@rcn.com
NNTP-Posting-Date: 10 Oct 2002 18:46:17 GMT
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MSMail-Priority: Normal