Secure Reputation-Based Authentication With Malicious Detection in VANETs