The animation linked below demonstrates the Diffie-Hellman key exchange. This technique allows two parties to agree a shared secret without a third party who is eavesdropping on their conversation being able to determine the shared secret they generate.