Implementation for hashing a salted password and verifying the hash.
コード例 #1
0
        public void SaltedHash_CanVerifyBadPass()
        {
            SaltedHash hash = new SaltedHash();
            string hashed = SaltedHash.Generate(good);

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

            result.Should().BeFalse();
        }
コード例 #2
0
        public void SaltedHash_CanVerifyCreatedHash()
        {
            SaltedHash hash = new SaltedHash();
            string hashed = SaltedHash.Generate(password);

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

            result.Should().BeTrue();
        }