Skip to content
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

[Patch] Use window.crypto.getRandomValues() if available #21

Open
GoogleCodeExporter opened this issue Feb 22, 2016 · 3 comments
Open

Comments

@GoogleCodeExporter
Copy link

Since some time, WebKit implements a function called 
window.crypto.getRandomValues() that generates cryptographically secure random 
values using the operating system's entropy pool. This feature is just now in 
the process of being integrated into Gecko, too:

https://bugzilla.mozilla.org/show_bug.cgi?id=440046

The attached patch checks if getRandomValues() and, if available, uses it, 
while falling back to Math.random() otherwise. I tested it on both Chromium 
(which has getRandomValues) and Firefox (which currently doesn't) and it seems 
to work fine, with the right code path being used.

Original issue reported on code.google.com by denis.a....@gmail.com on 10 Jan 2012 at 5:37

Attachments:

@GoogleCodeExporter
Copy link
Author

Original comment by Jeff.Mott.OR on 26 Jan 2012 at 7:25

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

IE11 added this functionality, but prefixed ( window.mscrypto.getRandomValues() 
http://msdn.microsoft.com/en-us/library/ie/dn302324(v=vs.85).aspx )

Original comment by lambda...@gmail.com on 18 Aug 2014 at 4:33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant