Man-in-the-middle attack

A Man-in-the-middle attack is a form of attack on cryptography or communication systems where two parties who want to talk to each other pass their messages through a third. In the attack, the third party can read the messages, change their contents, withhold or insert new messages.
In the attack, the messages received by either end seem to be legitimate and from the correct source.
In cryptography, this is often a problem with key distribution, and gave rise to public key cryptography.