-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Native crypto module could not be used to get secure random number. #256
Comments
I'm having the same issue, thrown during encryption using any of the cypher algorithms |
@rkdqudtjs1 Hmm, the fix is to not use |
Thanks @liamross |
I got same issue after upgraded to Seems like the error was thrown from below code lines (which were added on
|
That code does not generate a uniformly distributed floating point number anyway, therefore is probably even more insecure than https://nodejs.org/api/buffer.html#buffer_buf_readfloatle_offset Regardless of this, what this does is non-sense, as the only use of that function is to generate random bytes with the |
"crypto-js": "^3.1.9-1" How to fix this ? Critical Issue |
The new |
Just in case anyone stumbles onto this, it looks like this is breaking any react native project using simple-crypto-js, particularly in AppCenter which I assume is due to it being a Linux distribution. |
You may have to fix the version at - "crypto-js": "^3.1.9-1"
+ "crypto-js": "3.1.9-1" |
This is the pull request #257 working on a fix. Reviews are welcome, don't want to mess it up again. |
There is a new version Please keep in mind, that |
Does that mean we can't use |
Yes, than you have to stay with That's why it's added in the release notes. If you find another way to provide cryptographically secure random numbers without crypto module, you're welcome to share the solution. |
For all using CryptoJS in React Native please help to review this pull request #259. |
I do not use crypto, but I also use AWS Amplify with react-native. I get this error. How to fix? |
That decides me!
|
Why did you not release a major version for such a breaking change? Please release 3.2.2 with whatever was in 3.1 and make a 4.0.0 for the new stuff. That's what semver is there for. |
As the |
Hence why you should release 3.2.2 with whatever works in 3.1 and release a major version so this does not impact libraries that use semver correctly. |
Provided a version There is a new |
This response is for anyone landing here and getting an error from aws-amplify or amazon-cognito-identity-js library. This answer is not related to crypto-jsit looks like this issue may be coming up for many people due to the context in which they are executing the
If for some reason
In my case, I'm getting this error when testing a React App using Jest while my A way I found to correct this issue while testing with jest is to use the following
and inform my
|
Downloaded this library and landed here on 22/04/2022. But unfortunately, it seems this error still persists till date and downgrading to 3.1.9-1 still seems to be the valid solution to this problem........ |
05/01/2022 - Still a problem.... The fix is as stated above, "3.1.9-1" |
having this issue with |
@AlenToma right did you get any solution? |
|
I have the same error. I'm using Does anyone have a solution? |
This still works today (2022/10/12) |
This also worked as of 2022/10/17 |
Also worked as of 2022/12/6 when using it alongside Atlas MongoDB triggers |
This reverts commit 00bffd9.
Hi, everyone. I got the same issue with [email protected] and [email protected]. |
I am on
|
Getting the same issue with react-native 0.71.7 and crypto-js 4.1.1. The fix for me is to downgrade crypto-js to 3.1.9-1 as mentioned above. Not sure why the issue is closed? |
@Waddas This worked for me. RN 0.69, crypto-js: 4.1.1 |
@SandraLum |
Add logic to check if global exists. Move existing condition blocks into this block. Note that these global checks are for non-browser environments. For browser environments, add similar polyfill via the window global variable. Reference: - brix/crypto-js#256 (comment)
Add logic to check if global exists. Move existing condition blocks into this block. Note that these global checks are for non-browser environments. For browser environments, add similar polyfill via the window global variable. Reference: - brix/crypto-js#256 (comment)
Add logic to check if global exists. Move existing condition blocks into this block. Note that these global checks are for non-browser environments. For browser environments, add similar polyfill via the window global variable. Reference: - brix/crypto-js#256 (comment)
crypto-js npm runkit error.
run.
Error: Native crypto module could not be used to get secure random number.
The text was updated successfully, but these errors were encountered: