The shared secret returned by openssl_dh_compute_key is often used as an encryption key to secretly communicate with a remote party. This is known as the Diffie-Hellman key exchange.
ECDH is only supported as of PHP 8.1.0 and OpenSSL 3.0.0.
DH Public key of the remote party.
A local DH private key, corresponding to the public key to be shared with the remote party.
Returns shared secret on success or false on failure.
|8.0.0||private_key accepts an OpenSSLAsymmetricKey now; previously, a resource of type OpenSSL key was accepted.|