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 CSPRNG for private keys #246

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

junderw
Copy link
Contributor

@junderw junderw commented Dec 15, 2021

Fixes #245

In the event that Web Crypto API is not existent, nothing changes. But this usage will cover even IE11 so most browsers should be covered.

@meixler
Copy link

meixler commented Dec 16, 2021

@junderw, Thanks for your quick response to issue 245. This PR seems like it ought to solve the problem.

I like how you made the solution backward-compatible, so that if the user’s browser does not support Crypto.getRandomValues(), it falls back to the old method of generating random values for the private key.

In that case, perhaps the application should warn the user that it is using a non-CSPRNG to generate the private key?

@ghost
Copy link

ghost commented May 16, 2022

@OutCast3k This PR is a must have feature, could you review this?

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.

Consider changing coinjs.newPrivkey() function to use a CSPRNG to generate random values for private keys
2 participants