I’m looking for a MIT licensed javascript library to generate cryptographically random numbers.
I have to use to generate AES 128 keys, so the generator has to be something really good.
Unfortunately, all the (serious) library I found on Internet are GPL licensed and I can’t use them for legal reasons.
Do you know a usable library, which would be MIT licensed, or even better, public?
Thank you very much
This question is very similar to Generate cryptographically strong pseudorandom numbers in Javascript?.
JavaScript in a browser:
In Firefox and Chrome there is an experimental API to do this:
window.crypto.getRandomValues.Other in browser libraries are problematic, since gathering enough entropy in a browser is hard. So they often have a long startup time, or may produce low quality randomness.
A few random number generator libraries:
The first two probably meet your license requirement, since BSD is a permissive license. I’ve included the third for completeness.
node.js:
crypto.randomBytes