Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove note about /dev/urandom #14143

Closed
th opened this issue May 12, 2014 · 4 comments
Closed

Remove note about /dev/urandom #14143

th opened this issue May 12, 2014 · 4 comments

Comments

@th
Copy link

th commented May 12, 2014

The doc page for Crate rand features this note:

Note: on Linux, /dev/random is more secure than /dev/urandom, but it is a blocking RNG, and will wait until it has determined that it has collected enough entropy to fulfill a request for random data. It can be used with the Rng trait provided by this module by opening the file and passing it to reader::ReaderRng. Since it blocks, /dev/random should only be used to retrieve small amounts of randomness.

This is plain wrong.

Please see Daniel Bernstein in http://www.mail-archive.com/cryptography@randombit.net/msg04763.html

For a cryptographer this doesn't even pass the laugh test.

or my own essay at http://www.2uo.de/myths-about-urandom/

The note should be removed without replacement.

@huonw
Copy link
Member

huonw commented May 12, 2014

I take it you're saying just

/dev/random is more secure than /dev/urandom

is wrong, despite quoting the whole paragraph?

In any case, /dev/urandom does have a major problem

I'm not saying that /dev/urandom has a perfect API. It's disappointingly
common for vendors to deploy devices where the randomness pool has never
been initialized;

i.e. /dev/random is more secure than /dev/urandom in this case. (And in all other cases, it is no less "secure", although it does block, as stated in both the quoted documentation and your own essay.)

I emphasise "more" there because the paragraph carefully doesn't say that /dev/urandom is actually insecure; it's purely comparative.

In any case, #13820 clarifies that the quality problems with Linux's /dev/urandom are only during initialisation/when there are few entropy sources.

@lifthrasiir
Copy link
Contributor

cc @klutzy

@klutzy
Copy link
Contributor

klutzy commented May 13, 2014

#13820 (merged now) was the effort to fix this. Is it better now?

@th
Copy link
Author

th commented May 13, 2014

Yes, that's a pretty good note. Thanks!

@th th closed this as completed May 13, 2014
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 20, 2023
flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 20, 2025
Since `assign_op_pattern` is a style lint, not explicitly allowing it
can lead to undesirable output in other lint checks.

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants