-
Notifications
You must be signed in to change notification settings - Fork 10
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
srandom is not secure (README.md bugs) #13
Comments
I do agree that some of the documentation may be outdated. (unblocked /dev/random, for example). |
The resources show that xorshift is not cryptographically secure. So if you're using it to build a cryptographic primitive, you need to supply a proof of its security, which I don't see in your README. XORing two independent xorshift64 RNGs and discarding output likely isn't enough. |
Nobody can really prove anything. It needs to be disproved.
The closest I have to prove it provides random numbers is that it passes dieharder, which is well documented in the README. |
That's not true. Provable security is what you need to provide here. You've taken an insecure RNG and claimed that your construction is secure. However, you haven't provided any formal arguments in how. You haven't threat modeled the RNG showing how the state cannot be recovered from observing the output, which would be the bare minimum here.
I'm not the one claiming it's secure, so I don't need to prove anything or participate in any challenge. As stated, you've taken an insecure RNG and built a construction that you claim is secure. As such, the burden of proof rests on you. If you can't supply such a proof, then we can assume that it's not secure by falling back on the insecure primitive you chose.
Randomness tests such as Dieharder, NIST, TestU01, and PractRand don't prove security, only randomness. Plenty of insecure RNGs will pass randomness tests with flying colors while still remaining insecure. Mersenne Twister, PCG family, xorshift family, WELL family, multiply-with-carry, and plenty others are evidence of this. |
That's not how CSPRNGs work. It's you are given any reasonable amount of data (think 1 TiB) before and after, a reasonable amount of time (think 2^64), and you need to guess a bit at >50% probability. See https://github.com/Sc00bz/break-uheprng... oh right I improved it. Anyway an older version didn't try to guess the carry bit. So it was guessing a 53 bit int of either
No, UHEPRNG passes dieharder. Also this code passes all random tests but is obviously broken in a similar way that UHEPRNG is broken:
From README.md. Yeah that sounds like a timing attack. Assuming it can't be attacked in other ways. Also "anyone can create something that they themselves can't break, but that doesn't mean it's secure" or something like that. |
Shneier's Law: https://www.schneier.com/blog/archives/2011/04/schneiers_law.html |
I'll assume your done ranting... |
It's unfortunate you're closing the ticket without addressing the security concerns. You're unfortunately putting your users at high risk. You claim you've made a cryptographically secure RNG by taking xorshift64 and xoring it with another xorshift64 instance and discarding bits, but haven't provided any evidence to backup that claim. This isn't how secure programming or cryptography works. Using your kernel module for security is dangerous. |
#14 Looks like it's broken. |
The README.md file make false claims about security:
The xorshift family of PRNGs are not secure. Observing enough output can predict all future output with 100% accuracy. They should not be used for anything where security is required, such as cryptographic keys.
Some resources:
It's fine to create a separate kernel module for insecure PRNG needs, but it should not be replacing the cryptographically secure
/dev/urandom
.Also, because xorshift is not cryptographically secure, the following is very dangerous security practice:
A lot of development has changed with
random.c
in the Linux kernel since this README.md was initially written.Since Linux 4.8 (released in 2016), the RNG primitive replaced SHA-1 with ChaCha20. This produced a significant speed improvement:
/dev/random
has never been a true random number generator. Both/dev/random
and/dev/urandom
are userspace device files that were exported from the same CSPRNG. The only difference being that/dev/random
prviously would block producing bytes when its output entropy pool size dropped below the input entropy pool size./dev/urandom
did not have such a check and as such would always produce random bytes.Further, since Linux 5.6 (released 2020), the
/dev/random
device file no longer blocks.The text was updated successfully, but these errors were encountered: