-
Notifications
You must be signed in to change notification settings - Fork 432
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
README: rand is not a crypto library #1514
base: master
Are you sure you want to change the base?
Conversation
I think it's worth to explicitly state that |
/// - Not to leak internal state through [`Debug`] or serialization | ||
/// implementations. | ||
/// - No further protections exist to in-memory state. In particular, the | ||
/// implementation is not required to zero memory on exit (of the process or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious.. is that because it's onerous to implement or causes a performance hit or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zeroize
? It's just not been done (so far). It has been implemented by the chacha20
crate, so we gain this feature when we switch (with a little adjustment to ThreadRng
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are useful clarifications that address the substance of #1358. Thanks for working through these.
Co-authored-by: Dan <[email protected]>
Co-authored-by: Dan <[email protected]>
Thanks for the review! |
[`zeroize`](https://crates.io/crates/zeroize) used buffers and generators. | ||
We do not automatically reseed on fork (see | ||
[`ThreadRng`](https://docs.rs/rand/latest/rand/rngs/struct.ThreadRng.html)). | ||
Rand cannot provide any guarantees of security. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can recommend using getrandom
directly if you need guarantees? Most crypto applications don't need a userspace CSPRNG, and I think this is what crypto libraries like ring do.
Closes #1358 by documenting what Rand is not.