Elliptic-curve Diffie–Hellman (ECDH) is a
key agreement protocol that allows two parties, each having an
elliptic-curve public–private key pair, to establish a
shared secret
In cryptography, a shared secret is a piece of data, known only to the parties involved, in a secure communication. This usually refers to the key of a symmetric cryptosystem. The shared secret can be a password, a passphrase, a big number, o ...
over an
insecure channel. This shared secret may be directly used as a key, or to
derive another key. The key, or the derived key, can then be used to encrypt subsequent communications using a
symmetric-key cipher
Symmetric-key algorithms are algorithms for cryptography that use the same Key (cryptography), cryptographic keys for both the encryption of plaintext and the decryption of ciphertext. The keys may be identical, or there may be a simple transformat ...
. It is a variant of the
Diffie–Hellman protocol using
elliptic-curve cryptography
Elliptic-curve cryptography (ECC) is an approach to public-key cryptography based on the algebraic structure of elliptic curves over finite fields. ECC allows smaller keys compared to non-EC cryptography (based on plain Galois fields) to provide e ...
.
Key establishment protocol
The following example illustrates how a shared key is established. Suppose
Alice
Alice may refer to:
* Alice (name), most often a feminine given name, but also used as a surname
Literature
* Alice (''Alice's Adventures in Wonderland''), a character in books by Lewis Carroll
* ''Alice'' series, children's and teen books by ...
wants to establish a shared key with
Bob, but the only channel available for them may be eavesdropped by a third party. Initially, the
domain parameters
Domain may refer to:
Mathematics
*Domain of a function, the set of input values for which the (total) function is defined
**Domain of definition of a partial function
** Natural domain of a partial function
**Domain of holomorphy of a function
*Do ...
(that is,
in the prime case or
in the binary case) must be agreed upon. Also, each party must have a key pair suitable for elliptic curve cryptography, consisting of a private key
(a randomly selected integer in the interval