Implementation for hashing a salted password and verifying the hash.
Exemplo n.º 1
0
        public void SaltedHash_CanVerifyBadPass()
        {
            SaltedHash hash = new SaltedHash();
            string hashed = SaltedHash.Generate(good);

            bool result = hash.VerifyHash(bad, hashed);

            result.Should().BeFalse();
        }
Exemplo n.º 2
0
        public void SaltedHash_CanVerifyCreatedHash()
        {
            SaltedHash hash = new SaltedHash();
            string hashed = SaltedHash.Generate(password);

            bool result = hash.VerifyHash(password, hashed);

            result.Should().BeTrue();
        }