🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #89645

Re: How to permit user to set the right part of message-id

#89645
From: Russ Allbery
Date: Fri, 23 Sep 2022 05:36
79 lines
4835 bytes
"Adam H. Kerman" <ahk@chinet.com> writes:

> Let's assume the issue applies to hosts on different News sites. Either
> the News administrator or user decides there's a legitimate privacy
> reason that it's not desireable to use the working domain of the News
> server or the user's own host. With better random number generators
> available these days, is it possible to ensure uniqueness considering
> the left part of the Message-ID only if multiple News sites or users
> start to use domains in the right half that they don't uniquely control
> but are harmless to use, like literally example.com?

Yes, assuming you have a good random number generator, any random number
generator suitable for a cryptographic key will probably be good enough
for this.  The constraints are slightly different, but avoiding collisions
across a fairly large space ends up looking somewhat similar to what you
need to get protection against brute-force attacks.

The general rule of thumb is that 128 bits is probably good enough for
anything (although I will say that hashes these days have mostly gone to
256 bits).  With base64 encoding, that's fairly compact:

    4k2LUqc6SWY6vcGiWefcag@example.com

Protection against collision is basically protection against a birthday
attack, and thus grows with the square root of the message ID space.  If I
remember the math correctly, when there are 2^128 message IDs, you'll have
a 50% chance of a collision in 2^64 message IDs, which is substantially
larger than the number of Usenet messages there are ever likely to be.  In
practice, this should get you to much less than 50% chance, basically low
enough that you don't have to care.

Even if you think that might not be enough somehow, if you add a timestamp
before the randomness, and you assume mostly non-malicious message ID
generators, you reduce the chances of a collision to effectively nothing
fairly easily, and now you don't care about how long Usenet will survive
with unlimited retention because every second you move into a new message
ID space.  That gives you a message ID that looks something like:

    EmQM4tZ4$4k2LUqc6SWY6vcGiWefcag@example.com

That takes the date as a number (20220922222200) and represents it in 6
bytes, which is good enough for the next 10,000 years.  With a timestamp,
I'm pretty sure you could cut that down to 64 bits and still be pretty
comfortable, which gives you something like:

    EmQM4tZ4$uYRo9tEy/80@example.com

which is quite compact.

> As long as you are thinking about this, can you give some consideration
> to appending a check digit to the left part?

> A certain user I shall not name (but many of you know exactly whom I am
> talking about) has been forging other users, copying their Injection
> headers for preloading into the proto forged article which is injected
> through the News site that he uses. He typically adds crossposted
> newsgroups that the actual author did not crosspost to.

> The original Message-ID is preloaded as well, but he gets around
> clashing Message-IDs by prepending a character.

> A check digit might prevent that. Of course, he'll find all new ways to
> commit abuse.

I'm not sure I understand how a check digit helps.  The check digit won't
match and... then what?  You need some way to filter out the forged
messages, but most people aren't going to be using some new message ID
generation algorithm.  Also, since the whole message is forged, that
person can just make up a new message ID at the same domain with a good
check digit.

If the goal is for people to be able to opt in to forgery protection, some
sort of public key signature is a more obvious choice.

-- 
Russ Allbery (eagle@eyrie.org)             <https://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <https://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID: <87zgeqfy8k.fsf@hope.eyrie.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <632790d3$0$22052$426a74cc@news.free.fr> <87y1ufxary.fsf@hope.eyrie.org> <tgc30j$7s0o$4@news.trigofacile.com> <87sfkmxcsj.fsf@hope.eyrie.org> <tgje47$2eubv$4@dont-email.me>

Show Full Headers
Complete Article Headers
Message-ID: <87zgeqfy8k.fsf@hope.eyrie.org>
Subject: Re: How to permit user to set the right part of message-id
Date: Thu, 22 Sep 2022 22:36:43 -0700
From: Russ Allbery <eagle@eyrie.org>
References: <632790d3$0$22052$426a74cc@news.free.fr> <87y1ufxary.fsf@hope.eyrie.org> <tgc30j$7s0o$4@news.trigofacile.com> <87sfkmxcsj.fsf@hope.eyrie.org> <tgje47$2eubv$4@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.nntp
Organization: The Eyrie
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: hope.eyrie.org; logging-data="17068"; mail-complaints-to="news@eyrie.org"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:XyraqXHobyycRC0N7UrDccJgMA0=