Key exchange allows a sender to create secret information, such as random data that can be used as a key in a symmetric encryption algorithm, and use encryption to send it to the intended recipient.

Caution:

It is highly recommended that you not attempt to create your own key exchange method from the basic functionality provided, because many details of the operation must be performed carefully in order for the key exchange to be successful.