Exemplo n.º 1
0
        public static Key Create()
        {
            var prng = new WinCryptoPrng();
            var rnd  = prng.GetBytes(32);
            var key  = Hashes.SHA256(rnd);

            return(new Key(key));
        }
Exemplo n.º 2
0
        public static Key Create(string entropy)
        {
            var prng = new WinCryptoPrng();
            var rnd  = prng.GetBytes(32);
            var data = Encoders.ASCII.GetBytes(entropy);
            var key  = Hashes.HMACSHA256(rnd, data);

            return(new Key(key));
        }
Exemplo n.º 3
0
 public static Key Create(string entropy)
 {
     var prng = new WinCryptoPrng();
     var rnd = prng.Next();
     var data = Encoders.ASCII.Decode(entropy);
     var key = Hashes.HMACSHA256(rnd, data);
     return new Key(key);
 }
Exemplo n.º 4
0
 public static Key Create()
 {
     var prng = new WinCryptoPrng();
     var rnd = prng.Next();
     var key = Hashes.SHA256(rnd);
     return new Key(key);
 }