Question about entity authentication Say party A wants to make sure they are communicating with party B, and not an eavesdropper E. Then they will use an authentication scheme to do this.

But what if there is an eavesdropper on the line, who waits until the authentication is complete, and then steps in a poses as party B when it is finished? Then A will still think she is communicating with B. How is this prevented?
This is prevented by:


by requiring authentication of B using a private key only known to B and a public key trusted by A;
by making sure that messages are protected by a message authentication code (MAC) / authentication tag, created using a session key only known to A &amp; B.


Step 2 requires a key agreement step, e.g. Diffie-Hellman or the encryption of a secret by A to B using the public/private key pair of B.

I'm guessing that step 2: message authentication codes is what you're after. Message authentication codes provide integrity and authenticity for the messages they protect.

Note that you may also want to protect against replay attacks. Replay attacks however do not let E pose as B.