-
Notifications
You must be signed in to change notification settings - Fork 133
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
Is seeding wrong? #114
Comments
Hi yes You are right about the We discovered it independently when abstracting away calls to Random.secure. the reason for Is because on the nodejs runtime it fails to find Random.secure and a source of entropy needs to be sourced from the underlying platform. |
I'll leave this issue open until the tutorials are updated with the new code 😄 But feel free to close it if you think thats not necessary. |
Lol.. I am just waiting for it to sync up then I will do a release. MW |
Released: #115 |
While reading tutorials/rsa.md
I noticed that
seedSource.nextInt(255)
is used for seeding. Since in dartRandom.nextInt()
is exclusive, it should in my opinion beseedSource.nextInt(256)
to cover the whole value range of a unsigned 1 byte integer.If you search this repos files for
.nextInt(255)
this same thing will show up multiple times. In most places it's not cricital (examples and tutorials), but inlib\asymmetric\pkcs1.dart
andlib\asymetric\oaep.dart
it might be a serious security vulnerability.Edit: I noticed that
.nextInt(255)
was removed from the files inlib
I mentioned above just yesterday and replaced withbut not in the examples and tutorials.
The text was updated successfully, but these errors were encountered: