juliangruber / keypair

Generate a RSA PEM key pair from pure JS
Other
274 stars 51 forks source link

RNG by WebAssembly? #19

Open herzmut opened 3 years ago

herzmut commented 3 years ago

I like to leave it as an idea here, just to think about it or to research: how about porting a good and performant RNG as a WebAssembly library which provides API for JavaScript instead of using JavaScript's Math.random(), and using the latter as a fallback with a fair warning for developers?

Rust wraps providers of operating system's RNGs and it also discloses that some browsers support Crypto.getRandomValues() as a better RNG for cryptographic operations.