예제 #1
0
        public bool CheckPassword(string password)
        {
            var bytePassword      = Encoding.UTF8.GetBytes(password);
            var newHashedPassword = HashAndSalt.GenerateSaltedHash(bytePassword, Salt);

            return(newHashedPassword.CompareByteArrays(HashedPassword));
        }
예제 #2
0
        public void SetPassword(string password)
        {
            var bytePassword = Encoding.UTF8.GetBytes(password);

            Salt           = HashAndSalt.GetSalt(SaltLength);
            HashedPassword = HashAndSalt.GenerateSaltedHash(bytePassword, Salt);
        }