Using an agreement protocol such as Diffie-Hellman so two parties obtain a shared key without exposing it to eavesdropp…