Phobos randomUUID is not suitable to generate secrets

Johannes Pfau nospam at example.com
Sat Sep 5 16:26:49 UTC 2020


Am Sat, 05 Sep 2020 13:06:14 +0000 schrieb Paul Backus:

> On Saturday, 5 September 2020 at 10:41:34 UTC, Johannes Pfau wrote:
>> Unfortunately, we can not silently replace this overload to use a
>> secure RNG: On linux, would we use random or urandom? And the system
>> rng can block on low entropy, which could cause regressions in some
>> applications. Also some applications (like vibe.d) would probably
>> rather block a fiber than a thread, which complicates things more.
> 
> On linux, you would use /dev/urandom (or getrandom(2) if you don't need
> to support old kernel versions), since it is just as secure as
> /dev/random and does not block. [1]
> 
> [1] https://www.2uo.de/myths-about-urandom/

Hmm, good to know, thanks. Seems kinda stupid that urandom returns 
insecure data before it is first seeded at boot though, but I guess 
that's the way it is...

-- 
Johannes


More information about the Digitalmars-d mailing list