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

Add fresh_rng() #370

Closed
dhardy opened this issue Apr 4, 2018 · 3 comments
Closed

Add fresh_rng() #370

dhardy opened this issue Apr 4, 2018 · 3 comments
Labels
F-new-int Functionality: new, within Rand P-low Priority: Low

Comments

@dhardy
Copy link
Member

dhardy commented Apr 4, 2018

Add a wrapper around thread_rng which combines the output with fresh entropy from RDRAND, and call it fresh_rng.

Related to #314.

Advantage: a redundant security layer and some level of protection against forks, with relatively low overhead.

Disadvantage: we need to depend on @nagisa's rdrand crate. The crate is tiny and will depend on rand-core only so this is probably not an issue, though it could theoretically be in yet another crate (fresh_rng can't be in rdrand because that doesn't have access to thread_rng).

@nagisa I was wondering whether it would make sense to move rdrand into this repo as a sub-workspace, but that's not required.

@dhardy dhardy added F-new-int Functionality: new, within Rand P-low Priority: Low T-RNG labels Apr 4, 2018
@nagisa
Copy link
Contributor

nagisa commented Apr 5, 2018

I would be very much against fresh_rng if we were to only make it work "as intended" on a small variety of x86 platforms :) Why not simply have a MyAwesomeRng<EvenBetterRng: RngCore>?

This is 2nd time in 2 weeks somebody asked to move rdrand crate somewhere else. I wouldn’t mind that as long as it stays a separate crate.

@pitdicker
Copy link
Contributor

@dhardy. It seems I am shooting down all your ideas today.... Sorry.

What Amazons s2n does seems like a nice idea for them. Combining two reasonably fast secure RNGs to get something that should be even more secure.

To me it seems a bit niche and paranoid. And as @nagisa points out it is designed for and tied to a specific platform. Doesn't that make it more suitable to living in an external crate?

Besides that, I would be interested in two experiments. How real is the concern for forks? And what is the performance of a combined RNG like this?

@dhardy
Copy link
Member Author

dhardy commented Jun 15, 2018

Maybe I should just leave it to @nagisa to create the MyAwesomeRng wrapper type 😄 In any case, I think there are considerably more arguments against this idea than for, so will close.

@dhardy dhardy closed this as completed Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-new-int Functionality: new, within Rand P-low Priority: Low
Projects
None yet
Development

No branches or pull requests

3 participants