A man-in-the-middle attack (also called bucket-brigade attack or sometimes Janus attack) is one in which the attacker intercepts messages in a public key exchange and then retransmits them, substituting his or her own public key for the requested one, so that the two original parties still appear to be communicating with each other directly.