Is Math.random() cryptographically secure?

Nope; JavaScript’s Math.random() function is not a cryptographically-secure random number generator. You are better off using the JavaScript Crypto Library‘s Fortuna implementation which is a strong pseudo-random number generator (have a look at src/js/Clipperz/Crypto/PRNG.js), or the Web Crypto API for getRandomValues

Leave a Comment