I need to generate a secure 50 characters random string in the users browsers.
Looking at sjcl.prng I've got this so far:
$(document).ready(function () {
sjcl.random = new sjcl.prng(8);
sjcl.random.startCollectors();
$("body").on('mousemove', function() {
console.log(sjcl.random.getProgress(8));
if(sjcl.random.isReady(8) === 2) {
sjcl.random.stopCollectors();
console.log(sjcl.random.randomWords(5,8));
}
});
});
After moving the mouse around for a while I get a byte array like this: [-579285364, 1099191484, 94979086, -1572161987, -570940948]
.
But what I'm looking for is a 50 character alphanumeric string. My knowledge on this topic is limited and I'm looking for some help here.