A man-in-the-middle (MITM) attack is a form of active eavesdropping where the attacker intercepts messages between two victims and relays them while pretending to be each victim directly. The attacker must be able to impersonate each endpoint to the satisfaction of the other to succeed. Most cryptographic protocols use endpoint authentication to prevent MITM attacks, such as SSL authenticating both parties through a certification authority. Defenses include using strong encryption between clients and servers, with the server authenticating the client through a digital certificate before connecting, and avoiding open WiFi networks or using browser plugins to force secure connections.