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

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

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