lundi 15 octobre 2018

Right way to get random bytes from entropy audio source

i create application to generate random passwords, i've used microsoft algorithm implemented in Membership class as example. I made decision to use user voice as entropy source, i get sha1 of audio file and use bytes to get values of password:

 using (FileStream fs = new FileStream(filename, FileMode.Open))
 using (BufferedStream bs = new BufferedStream(fs))
 {
     using (SHA1Managed sha1 = new SHA1Managed())
     {
         byte[] hash = sha1.ComputeHash(bs);

         var pass = BitConverter.ToString(hash).Replace("-", string.Empty);

     }
 }

Please tell me passwords has been generated by this way is it Random ? Or i have to process audio file in different way ?




Aucun commentaire:

Enregistrer un commentaire