babel-preset-react-native-web3 icon indicating copy to clipboard operation
babel-preset-react-native-web3 copied to clipboard

Math.Random is insecure

Open agrcrobles opened this issue 7 years ago • 0 comments

Math.Random is predictable and insecure and the only way to get a secure source of entropy is by making a native call.

I am not entirely sure where web3 uses randomBytes, probably when mining, when creating a new hash for an account or a block.

To improve that there are choices like webview-crypto or react-native-securerandom.

See: https://github.com/agrcrobles/babel-preset-react-native-web3/blob/master/src/randombytes.js#L4

agrcrobles avatar Feb 04 '18 16:02 agrcrobles