%hide
%latex
\subsection*{4.3 Key Establishment Protocols}
The purpose of a key establishment protocol is to provide two parties communicating over an open network with a shared secret key, often called {\it session key.} The key may then be used in a symmetric algorithm. This is useful because asymmetric encryption schemes are much slower than their symmetric counterparts. By using public-key methods to exchange symmetric keys, the functionality of public key cryptography is combined with the speed of symmetric cryptography.
We have introduced one such protocol in Chapter 2, the Diffie-Hellman key exchange, and we have already seen how it can be used with arbitrary groups such as elliptic curves. A variant of this protocol, called {\it Elliptic Curve Diffie-Hellman} (ECDH), is included in the ANSI X9.63 standard. It is part of the TLS protocol, a successor of SSL and widely used for secure internet connections, particularly HTTPS.
ECMQV is an elliptic curve version of the MQV key agreement protocol, named after its inventors Menzes, Qu, and Vanstone, and yet again based on the Diffie-Hellman key exchange. It has been standardized in ANSI X9.63, IEEE 1363-2000, and ISO/IEC 15946-3.
Note that the shared secret established in both protocols is originally a group element, i.e. a point on the curve. Some extra work has to be done in order to turn it into a useful session key. Usually, the $x$-coordinate of the point is represented as a binary string and used as input for a {\it cryptographic hash function} such as SHA-1. A cryptographic hash function takes an arbitrary length binary string as input and outputs a fixed length binary string, e.g. 160 bits in the case of SHA-1. It does this in a {\it random} way in the sense that the output cannot be predicted with the knowledge of the input without actually executing the function, in a {\it collision-free} way in the sense that two different inputs are highly likely to produce distinct outputs, and in a {\it one-way} manner in the sense that the output of the function can be efficiently calculated, but inverting the function is computationally infeasible. Such hash functions are fundamental cryptographic primitives and are part of almost all protocols used in practice. In our scenario they are useful for turning the $x$-coordinate of a point into a session key of fixed length. Sometimes, when a session key longer than the output of the hash function is required, the $x$-coordinate is concatenated with a counter and hashed several times, thus yielding a longer session key by concatenation of the subsequent outputs.