Exemplo n.º 1
0
        static void Main(string[] args)
        {
            string hashedPassword = HashWithSlat.GenerateHash("1");

            //string hashedPassword = HashWithSlat.GenerateHash("P@ssw0rd");

            var result = HashWithSlat.VerifyHashedPassword(hashedPassword, "P@ssw0rd");

            Console.WriteLine(result);
        }
Exemplo n.º 2
0
        public bool Verification(string userID, string password)
        {
            string passwordHash = GetByPasswordHash(userID);

            if (!string.IsNullOrEmpty(passwordHash))
            {
                var result = HashWithSlat.VerifyHashedPassword(passwordHash, password);
                if (result == PasswordVerificationResult.Success)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }