/dev/random vs /dev/urandom

This cluster discusses the differences, myths, and best practices for using /dev/random versus /dev/urandom as entropy sources in Unix-like systems, with many comments recommending /dev/urandom and linking to articles debunking outdated concerns about its security.

πŸ“‰ Falling 0.2x Security
2,858
Comments
18
Years Active
5
Top Authors
#4153
Topic ID

Activity Over Time

2009
26
2010
7
2011
39
2012
33
2013
326
2014
482
2015
256
2016
275
2017
163
2018
142
2019
355
2020
140
2021
164
2022
206
2023
88
2024
85
2025
70
2026
1

Keywords

e.g RNG DDR4 ARM CryptGenRandom AMD HN ycombinator.com FWIW PGP dev entropy random pool generator openbsd boot secure kernel null

Sample Comments

suifbwish β€’ Aug 17, 2021 β€’ View on HN

What’s wrong with just using /dev/urandom for the entropy pool?

marcosdumay β€’ Mar 1, 2016 β€’ View on HN

It's manpage also says the same.It is a cryptographically secure PRNG, but during a small time in system start up, it may not be correctly seeded.If you need long term keys, it may be better to get some 256 bits from /dev/random before using /dev/urandom.

gpvos β€’ Jul 15, 2014 β€’ View on HN

You're completely wrong. According to the OpenBSD devs, on modern BSDs and Linux, /dev/urandom is as good a source of entropy as anything. It's commonly implemented by a good cryptographically secure pseudo-random generator. This code only gets called in cases where /dev/urandom is not available (for example in a chroot jail or when the file descriptor limit is reached).

yolesaber β€’ Apr 25, 2016 β€’ View on HN

Use /dev/urandom instead of /dev/randomhttp://www.2uo.de/myths-about-urandom/

Tomte β€’ Aug 22, 2017 β€’ View on HN

No, that difference (between /dev/random and /dev/urandom) does not exist, has never existed and will never exist. Please don't spread those myths.

yuhong β€’ Jun 27, 2014 β€’ View on HN

I think the Linux /dev/random already do this to some extent.

RKearney β€’ Jun 25, 2013 β€’ View on HN

You probably want to use urandom instead of random. /dev/random will block if the entropy pool runs out whereas /dev/urandom will not.

filleokus β€’ Aug 22, 2017 β€’ View on HN

Quite a long read, but I think it explains the situation quite well: https://www.2uo.de/myths-about-urandom/

raverbashing β€’ Aug 15, 2013 β€’ View on HN

And why /dev/urandom instead of /dev/random?

caf β€’ Mar 8, 2014 β€’ View on HN

Since /dev/urandom and /dev/random draw from the same pool, it should be enough to simply read and throw away some bytes from /dev/random.