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

use crypto.getRandomValues() for scramble extension #678

Merged
merged 1 commit into from
Jul 5, 2018
Merged

use crypto.getRandomValues() for scramble extension #678

merged 1 commit into from
Jul 5, 2018

Conversation

lsching17
Copy link
Contributor

crypto.getRandomValues() is more secure than Math.random() for scrambling keyboard

@lsching17 lsching17 changed the title use crypto.getRandomValues() from scramble extension use crypto.getRandomValues() for scramble extension Jul 5, 2018
@Mottie
Copy link
Owner

Mottie commented Jul 5, 2018

Hi @lsching17!

Thanks for your work, but would you please add a check for window.crypto and fallback to using Math.random...

I noticed that IE11 & IE mobile require a ms prefix (msCrypto.getRandomValues()). And I know this library has been used on a raspberry pi and some tv's, so I don't really know if they support the crypto API.

@lsching17
Copy link
Contributor Author

modified, now fall back in the following order: window.crypto -> window.msCrypto -> Math.Random

tested in IE11, Firefox 60 and Chromium 66

@Mottie Mottie merged commit 3c5d3d8 into Mottie:master Jul 5, 2018
@Mottie
Copy link
Owner

Mottie commented Jul 5, 2018

Awesome, thanks!

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

Successfully merging this pull request may close these issues.

2 participants