Elliptic-curve Diffie-Hellman (ECDH) is a key agreement algorithm that allows users to calculate a secret key using the public-private key pair and the generator point on the elliptic curve being used. This secret key allows both parties to communicate securely over an
ECDH is a variant of the Diffe-Hellman algorithm that is based on elliptic curves. It is very similar to the classical Diffie-Hellman algorithm being used to exchange keys securely. ECDH, instead of doing exponential of keys like Diffe-Hellman, uses elliptic curve cryptography multiplication to calculate the keys.
ECDH performs the key agreement process in two steps, key generation, and secret key calculation explained below.
The process of generation of two keys, private and public, is as follows:
The private key is a randomly selected number
The public key is given as
This process is repeated twice as there are two users involved in a communication, and they both require a set of public and private keys. The private key is kept secret by the user who generated it and not shared with anyone. However, the public key along with
The secret key is calculated by both the users using the publicly available information of the other user and their own private keys. The secret key is calculated by user A by using this equation.
Where
User B also performs the same steps to calculate the secret key by using this equation.
Where
If we simplify the secret keys calculated by both the users, we can see that they are equal.
This secret key was calculated and agreed upon by both users following the ECDH algorithm. The calculation of the secret completed the key agreement process.