And the correct answer is the second and third options.
The first one is not true. Alice can determine the key using
the typical Diffie-Hellman protocol as discussed in the Unit 3
by taking the value G to the power Y and raising
it to the power X. The fourth option is not true; adding the
hash to the message actually increases the size of it.
To see whether second and third options are true, let’s take
a look at what could happen without including the hash.
So Alice picks the value X, calculates G of X and
encrypts G of X with Bob’s public key. She then tries to send
this to Bob. Now, you could intercept the message, then
send a different value to Bob, Bob recalculate the key,
G of X prime Y. Bob would then send G of Y which Mallory
could intercept and send a new value to Alice.
Alice would then calculate a non-sense key and have no
idea that the key she has calculated is worthless. Adding the
hash value of the key to this protocol allows Alice to verify
that she has a valid key that came from Bob and not
from some attacker in the middle.
