  in cryptography and computer security, the man-in-the-middle attack (often abbreviated to mitm, mitm, mim, mim or mitma) requires an attacker to have the ability to both monitor and alter or inject messages into a communication channel. one example is active eavesdropping, in which the attacker makes independent connections with the victims and relays messages between them to make them believe they are talking directly to each other over a private connection, when in fact the entire conversation is controlled by the attacker. the attacker must be able to intercept all relevant messages passing between the two victims and inject new ones. this is straightforward in many circumstances; for example, an attacker within reception range of an unencrypted wi-fi wireless access point, can insert himself as a man-in-the-middle. as an attack that aims at circumventing mutual authentication, or lack thereof, a man-in-the-middle attack can succeed only when the attacker can impersonate each endpoint to their satisfaction as expected from the legitimate other end. most cryptographic protocols include some form of endpoint authentication specifically to prevent mitm attacks. for example, tls can authenticate one or both parties using a mutually trusted certification authority. == need for additional transfer over a secure channel == all cryptographic systems that are secure against mitm attacks require an additional exchange or transmission of information over some kind of secure channel. many key agreement methods have been developed, with different security requirements for the secure channel. interlock protocol attempts to address this. == example of an attack == thumb|200px|right|illustration of man-in-the-middle attack. suppose alice wishes to communicate with bob. meanwhile, mallory wishes to intercept the conversation to eavesdrop and possibly (although this step is unnecessary) deliver a false message to bob. first, alice asks bob for his public key. if bob sends his public key to alice, but mallory is able to intercept it, a man-in-the-middle attack can begin. mallory sends a forged message to alice that claims to be from bob, but instead includes mallory's public key. alice, believing this public key to be bob's, encrypts her message with mallory's key and sends the enciphered message back to bob. mallory again intercepts, deciphers the message using her
Computer_network_security Cryptographic_attacks