-
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
ReseedingRng
: combine fresh and old state?
#301
Comments
I'm fine with roughly this scheme but.. I'm wondering if Also, there would be no benefit from many cartographic hash function requirements, like collision resistance, so if one want hashing then we're talking more SipHash, but SipHash itself has too little output, so maybe some simple construction inspired by hash functions, like SipHash. |
Is there any benefit to hash functions? I suppose there's avalanche: make each output bit affected by every (or at least multiple) input bits. Assuming both input keys are the output of cryptographic PRNGs / have low bias, I don't see any real benefits from hashing. |
I've no particular argument for hashing either. I've no variable-width ARX construction examples even. And endianness issues with the |
This seems all very theoretical to me. Whether you need to use I see no harm in it, but feel like we are over-thinking. |
How shall we proceed with this issue? It seems overly cautious to me, but not without merit. Maybe we should just do it? One small disadvantage is that it would have to use |
I don't know; it's not high priority however. I guess the overhead should be small even if this computation is complex. Perhaps we should forget it; I mean the only real advantage of this scheme is extra protection in case someone is able to manipulate the OS RNG, but if they can do that you probably have bigger problems anyway. |
@tarcieri can I get your opinion on this? Realistically the only reason I can see it being useful is if a bug reduces the entropy source's quality (e.g. AMD's RDRAND failure on resume-from-standby). Note that we already catch failures here and do catch this particular bug; this change would only help with bugs we haven't caught. Of course if the source is compromised it seems pointless to assume anything else. |
Reseeding, done correctly, is at least as secure as the most secure of the inputs. That said I'd need to see code to know if the desired solution is secure. |
Is the pseudo-code in the first post clear enough? If not, I can make a PR. To go ahead, this needs to:
|
This doesn't appear to be necessary. |
My comment, from #298:
Pseudocode:
Using XOR to combine two keys has the disadvantage that if an attacker knows one input and the output then he can learn the other key, but that shouldn't matter here: one key comes from the OS (should be secure) and the other from the old generator — we assume cryptographic, hence knowledge of output should not allow calculation of state.
Theoretical advantage: if the external entropy source becomes compromised, the reseeded RNG may still remain secure. (Whether this advantage is significant or worthless I don't know.)
Performance impact: should be low I think since reseeding only happens rarely.
The text was updated successfully, but these errors were encountered: