public void HashAndVerify()
        {
            var    hasher = new SaltedSha256HashProvider();
            string secret = "125f5sfasdfasdfsadfee";
            var    h      = hasher.ComputeHash(secret.ConvertToByteArray());

            Assert.IsTrue(hasher.VerifyHash(secret.ConvertToByteArray(), h));
        }
Example #2
0
        public void HashAndVerify_strings()
        {
            var    hasher = new SaltedSha256HashProvider();
            string secret = "andrada";
            var    hash   = hasher.ComputeHash(secret);

            Assert.IsTrue(hasher.VerifyHash(secret, hash));
        }
        public void GenerateSaltedHashes()
        {
            var    hasher = new SaltedSha256HashProvider();
            string secret = "ChangeMe123$";
            var    b      = secret.ConvertToByteArray();

            for (var i = 0; i < 20; i++)
            {
                var key = hasher.ComputeHash(b);
                Console.WriteLine(key.ConvertToBase64String());
            }
        }