vendredi 24 avril 2020

JavaScript window.crypto.getRandomValues safe to use for AES?

Is window.crypto.getRandomValues safe to use as a secret key for AES encryption?

This is my code to generate the secret key:

        let key = "";
        var array = new Uint32Array(10);
        window.crypto.getRandomValues(array);
        for(let num of array){
          key += num.toString();
        }
        key = key.substring(0, 20);



Aucun commentaire:

Enregistrer un commentaire