protected bool IsValidPassword(string password, string storedPassword, bool hashed, string salt) { return(storedPassword == (hashed ? SecurityHelper.HashPassword(password, salt) : password)); }