Exemple #1
0
        private static SaltHashCombo EncryptPassword(string salt, string password)
        {
            var output = new SaltHashCombo();

            output.salt = salt;
            var hashArray = crypter.ComputeHash(Encoding.UTF8.GetBytes(salt + password));

            output.hash = ByteArrayToHexString(hashArray);
            return(output);
        }
Exemple #2
0
        public static bool VerifyPassword(string attempt, SaltHashCombo saltHashCombo)
        {
            var toTest = EncryptPassword(saltHashCombo.salt, attempt);

            return(toTest.hash == saltHashCombo.hash);
        }