예제 #1
0
        public void TestBcryptVerify()
        {
            HashCreator h     = new HashCreator();
            string      hashe = h.HashMDP("");

            Assert.AreEqual(true, h.checkMotDePasse("", "$2a$10$cCCVc6odqxDpcmEsnqDYM.dAysJsC0PYxifFSUU8bAPuwjmSNX5GG"));
            Assert.AreEqual(false, h.checkMotDePasse("", "$2a$10$wffrNsHbvNJOtilp0U08q.rcYKwQuc9swHns9GE8AblaIMxlghvIK"));
            Assert.AreEqual(false, h.checkMotDePasse("", "$2a$10$eB4ot372dJty1O3HnKQcZeOITUiwcpQCDHw3McIbfOSqRVyRu.EJe"));

            HashCreator h2 = new HashCreator();

            Assert.AreEqual(true, h2.checkMotDePasse("", hashe));
        }