GNU bug report logs -
#58472
[PATCH] Make `message-unique-id' less prone to collisions
Previous Next
Reported by: Stefan Kangas <stefankangas <at> gmail.com>
Date: Wed, 12 Oct 2022 16:09:01 UTC
Severity: wishlist
Tags: patch
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #43 received at 58472 <at> debbugs.gnu.org (full text, mbox):
Paul Eggert <eggert <at> cs.ucla.edu> writes:
> That info is in the Date: line, along with zillions of other Received:
> lines. There should be no need to repeat it in the Message-ID line.
OK, let's use only random data.
> If that's a concern, we should be using more-random data, e.g., with
>
> (base64-encode-string
> (secure-hash 'md5 'iv-auto 128 nil t))
>
> if we want 128 bits of randomness (this yields a string like
> "B8a3usyu5QSE/rTLu0nIHg==").
Sounds good to me, but:
The only reference I find to `iv-auto' is in (info "(elisp) Format of
GnuTLS Cryptography Inputs"). The `secure-hash' OBJECT parameter is
documented like this:
The argument OBJECT should be a buffer or a string.
Is the documentation incomplete?
> As an aside, it's weird that there's no easy way to ask Emacs for an
> N-bit random integer, where the randomness is taken from system entropy.
> Shouldn't we extend Emacs to support that? E.g., (make-string 128
> 'iv-auto) could give you an N-byte entropy-derived random string, or
> (random -N) could give you an N-bit entropy-derived random nonnegative
> integer, or something like that. Then we could write something like this:
>
> (base64-encode-string (make-string 16 'iv-auto))
>
> to get a Message-ID component with 16 bytes (128 bits) of entropy.
Yes, we should find a better interface here.
We also have `cl-random', which I think support float values. Perhaps
`random' should do the same? (See also Bug#9103.)
Oh, and whatever we do, we should probably also document it in `(elisp)
Random Numbers'.
This bug report was last modified 2 years and 173 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.