Does Diffie Hellman guarantee secrecy? I am studying my Cryptology exam and one question I got stuck below;


  Recall the Diffie-Hellman key establishment protocol. Alice runs this protocol over
  the Internet to communicate with Bob. Assume that the agreed key after running
  the protocol is k = g^ab (mod p). Alice then computes SHA256(k) and uses this
  as the key to encrypt a message m using AES. The resulting ciphertext is then
  sent to Bob.
  a) Does this protocol guarantee the secrecy of m?


I know that perfect secrecy is if the ciphertext provides no information about the plain text. Can somebody explain the above question to me?
The problem with this question is that it doesn't establish if the keys are static or not. If the keys are both static and a static-static (2S) DH protocol is used, then yes, this could guarantee secrecy if the public keys can be trusted to be from the right party, thereby authenticating A to B and B to A. A little used option of TLS is to use Diffie-Hellman based certificates, for instance.

Otherwise you're missing the authentication step, and Mallory could perform a man-in-the-middle by establishing keys A-M and M-B by tricking A and B that they are creating a secure channel to each other. Note that this is an active attack. it only works for Mallory - who can perform active attacks, not for Eve who can only eavesdrop the communication. Therefore "no" is most likely the correct answer.