Hacker News new | ask | show | jobs
by nailer 1140 days ago
That sounds incorrect, though WASM you have access to webcrypto getrandombytes which is native OS randomness.
1 comments

Yes, but that wasn't even the problem.

Trust Wallet needlessly wrapped `std::random_device` (which might or might not be cryptographically secure by itself, depending on how it's implemented in whatever WASM-generating stack they use) in an instance of `std::mt19937` (which is definitely insecure, whether seeded cryptographically or not, due to being seeded with only 32 bits of entropy in their implementation; but even seeded properly, a Mersenne Twister would eventually leak internal state).