Diffie-Hellman key exchange is a protocol that allows two parties to establish a shared secret key.
Include and example how to use DH_new() and friends here.
See the library functions here: Diffie-Hellman functions