-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 MT19937 PRNG #4636
Remove MT19937 PRNG #4636
Conversation
I think this is good to merge as it's pretty straightforward 😄 Thanks @konovod 👍 |
I don't think it is good to remove them. And there is another point for leaving them: they are really good reference implementations for those algorithms. They are so much more readable than versions on other language, so they could be used as a promotion for Crystal :-) |
@funny-falcon did you see #4634? We're just moving them to a n external shard. |
MT19937 is much worse for poker games or other things where PCG can be attack target. Despite it's high period it is completely predictable after seeing ~600 consequent numbers. So IMHO it should be removed. About ISAAC - i think that there could be a secure PCG with higher period, something intermediate between safe but slow |
I'd better use And ISAAC looks to be reasonably fast as well. |
|
@ysbaddaden , then ChaCha12 . The best known "theoretical attack" is against 7 rounds of ChaCha. So ChaCha12 is really far from being compromised. I was really disappointed that ChaCha20 and not ChaCha12 were wildely accepted. ChaCha20 were original conservative author's choice. But analyses of ChaCha became public a long before standartisation, so it is quite surprising ChaCha12 were not preffered choice, because ChaCha12 has same speed as hardware optimized AES, but ChaCha20 is 1.5x slower. I'd even use ChaCha8 for non-secure RNG - not compromised yet, and very fast. I think, it is same story as with SipHash: author recommended SipHash24 as concervative choice for secure applications in original paper, and everyone rush to use it as hash function for hash tables. But SipHash13 is safe enough for such use case. And I spend a lot of effort to convince Rust and Ruby to switch to SipHash13. (but I still think, SipHash is overkill for this (even SipHash13), so I propose simpler function for Crystal). Note: for ChaCha to be fast Crystal have to provide SSE intrisicts. |
If we agree on 1. let's update this PR to drop MT19937 only, and keep ISAAC for the time being. We can continue discussing in #4634 whether we want to keep distributing a secure PRNG in stdlib and which one. I'm fine with this idea, and like either ISAAC or ChaCha12. |
Removing MT19937 sounds like a good idea to me. |
I've updated PR to remove only Mersenne. |
Thank you! Let's continue under #4634 now. |
fixes #4634