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

            return(new Key(key));
        }
Beispiel #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));
        }