Let us assume the following: Alice and Bob are performing Diffie-Hellman key exchange over an unprotected channel. Eve is an active attacker (capable of dropping, modifying and constructing packets on the channel). Let's say that Alice and Bob can visually verify (by looking at an image generated from the hash or a letter-by-letter comparison of the base64 code), things that appear on their screens - I am strongly against visual verification of this kind because it is too easy for a naive user to accidentally provide a MiTM attack surface, however this is not the main question. The main question is which of the following is better:
- Verify the hash of received DH-parameters (possible caveat: key sizes are much larger than hashes! And similar hashes are hard to tell apart visually)
- Verify the hash of the exchanged key
An answer detailing advantages/disadvantages of both would be amazing (especially considering that the idea of visual verification of received parameters is quite tempting and maybe this question will help avoid the same problem Telegram has).