-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Always use CryptoRNG
as the default
#126
Always use CryptoRNG
as the default
#126
Conversation
It is safer to assume that anyone that needs a possible performance gain by switching to |
Another place to fix is in the README where we have: Line 17 in 65979d4
|
Thank you all for the changes. Let me look back at some old tickets and changes, because there was a reason I started defaulting to the non-secure one. Also, I need to see if this is a breaking change. If it only affects B4, it should be fine. As the only way to manipulate the seed is using MathRNG explicitly, bypassing the default. v5 I think used v4 under the hood. And anything with a random component uses the RNG. So v1, v6, v7, and v8 are affected accordingly. |
It might be tempting to release this as version It should be released as version |
Wait the current released version is |
No, I was in the process of, but I'm in the middle of a move to Europe, and the last month or so have been a complete chaos storm and I am flying next week. I can include it in the 4.5.0 release since there are a lot of changes there as is. |
Ok, I went through the history. The original move to MathRNG as default was in 0.5.1, due to performance issues and I was using a custom AES implementation back then as the crypto package and pointycastle didnt exist yet. I then made it default in 2.0.0 again but it broke in IE11 (which was supported at the time) because Random.secure didn't work and I had switched to it. So I think it's fine to switch to Crypto by default now. |
Thanks again, I will try to make a release shortly. |
If we end up do have less performance on some platforms, I do think we can get some of that back again when this gets released at some point: https://dart-review.googlesource.com/c/sdk/+/322861 Since this will fetch enough random data to fill the list in one go instead of doing multiple calls that we are doing now. |
This looks great. I'll switch to it once it's released. |
@daegalus Thank you for the quick turnaround on this! |
Fixes #125
As mentioned here
The default RNG implementation should be
Random.secure()
not the plainRandom()