コード例 #1
0
        public void PositivePBKDF1CompareTest()
        {
            string password = "******";

            PasswordHashing provider = new PasswordHashing(algorithm: PasswordHashing.ALGORITHM.PBKDF1);

            string hash   = provider.Compute(password);
            bool   result = provider.Compare(password, hash);

            Assert.IsTrue(result);
        }
コード例 #2
0
        public void PositiveCompareTest()
        {
            string password = "******";

            PasswordHashing provider = new PasswordHashing();

            string hash   = provider.Compute(password);
            bool   result = provider.Compare(password, hash);

            Assert.IsTrue(result);
        }
コード例 #3
0
        public void NegativeCompareTest()
        {
            string password      = "******";
            string wrongPassword = "******";

            PasswordHashing provider = new PasswordHashing();

            string hash   = provider.Compute(password);
            bool   result = provider.Compare(wrongPassword, hash);

            Assert.IsFalse(result);
        }