Diffie-Hellman key exchange (D-H) is a cryptographic protocol that allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure communications channel. A security protocol ( cryptographic protocol or encryption protocol) is an abstract or concrete protocol that performs a security -related function In Cryptography, a key is a piece of information (a Parameter) that determines the functional output of a cryptographic algorithm Communication is the process of conveying information from a sender to a receiver with the use of a medium in which the communicated information is understood the same way This key can then be used to encrypt subsequent communications using a symmetric key cipher. Symmetric-key algorithms are a class of Algorithms for Cryptography that use trivially related often identical Cryptographic keys for both decryption In Cryptography, a cipher (or cypher) is an Algorithm for performing Encryption and Decryption &mdash a series of well-defined steps
Synonyms of Diffie-Hellman key exchange include:
The scheme was first published publicly by Whitfield Diffie and Martin Hellman in 1976, although it later emerged that it had been invented a few years earlier within GCHQ, the British signals intelligence agency, by Malcolm J. Williamson but was kept classified. Bailey Whitfield 'Whit' Diffie (born June 5 1944) is a US Cryptographer and one of the pioneers of Public-key cryptography. Martin Edward Hellman (born October 2, 1945) is a cryptologist, famous for his invention of Public key cryptography in cooperation with Year 1976 ( MCMLXXVI) was a Leap year starting on Thursday (link will display full calendar of the Gregorian calendar. The Government Communications Headquarters (GCHQ is a British Intelligence agency responsible for providing Signals intelligence (SIGINT and Information Malcolm J Williamson discovered in 1974 what is now known as Diffie-Hellman key exchange. In 2002, Hellman suggested the algorithm be called Diffie-Hellman-Merkle key exchange in recognition of Ralph Merkle's contribution to the invention of public-key cryptography (Hellman, 2002). See also 2002 (disambiguation Year 2002 ( MMII) was a Common year starting on Tuesday of the Gregorian calendar. Ralph C Merkle (born February 2, 1952) is a pioneer in Public key cryptography, and more recently a researcher and speaker on Molecular nanotechnology Public-key cryptography, also known as asymmetric cryptography, is a form of Cryptography in which the key used to encrypt a message differs from the key
Although Diffie-Hellman key agreement itself is an anonymous (non-authenticated) key-agreement protocol, it provides the basis for a variety of authenticated protocols, and is used to provide perfect forward secrecy in Transport Layer Security's ephemeral modes. In Cryptography, a key-agreement protocol is a protocol whereby two or more parties can agree on a key in such a way that both influence the outcome In an authenticated Key-agreement protocol that uses Public key cryptography, perfect forward secrecy (or PFS) is the property that ensures that a session Transport Layer Security ( TLS) and its predecessor Secure Sockets Layer ( SSL) are Cryptographic protocols that provide secure
Diffie-Hellman key agreement was invented in 1976 during a collaboration between Whitfield Diffie and Martin Hellman and was the first practical method for establishing a shared secret over an unprotected communications channel. Year 1976 ( MCMLXXVI) was a Leap year starting on Thursday (link will display full calendar of the Gregorian calendar. In Cryptography, a shared secret is a piece of data only known to the parties involved in a secure communication Ralph Merkle's work on public key distribution was an influence. Ralph C Merkle (born February 2, 1952) is a pioneer in Public key cryptography, and more recently a researcher and speaker on Molecular nanotechnology John Gill suggested application of the discrete logarithm problem. In Mathematics, specifically in Abstract algebra and its applications discrete logarithms are group-theoretic analogues of ordinary Logarithms It had been discovered by Malcolm Williamson of GCHQ in the UK some years previously, but GCHQ chose not to make it public until 1997, by which time it had no influence on research in academia. Malcolm J Williamson discovered in 1974 what is now known as Diffie-Hellman key exchange. The Government Communications Headquarters (GCHQ is a British Intelligence agency responsible for providing Signals intelligence (SIGINT and Information The United Kingdom of Great Britain and Northern Ireland, commonly known as the United Kingdom, the UK or Britain,is a Sovereign state located Year 1997 ( MCMXCVII) was a Common year starting on Wednesday (link will display full 1997 Gregorian calendar
The method was followed shortly afterwards by RSA, another implementation of public key cryptography using asymmetric algorithms. In Cryptography, RSA is an Algorithm for Public-key cryptography. Public-key cryptography, also known as asymmetric cryptography, is a form of Cryptography in which the key used to encrypt a message differs from the key
In 2002, Martin Hellman wrote:
The system. See also 2002 (disambiguation Year 2002 ( MMII) was a Common year starting on Tuesday of the Gregorian calendar. . . has since become known as Diffie-Hellman key exchange. While that system was first described in a paper by Diffie and me, it is a public key distribution system, a concept developed by Merkle, and hence should be called 'Diffie-Hellman-Merkle key exchange' if names are to be associated with it. I hope this small pulpit might help in that endeavor to recognize Merkle's equal contribution to the invention of public key cryptography. 
, now expired, describes the algorithm and credits Hellman, Diffie, and Merkle as inventors.
The simplest, and original, implementation of the protocol uses the Multiplicative group of integers modulo p, where p is prime and g is primitive root mod p. In Modular arithmetic the set of Congruence classes Relatively prime to the modulus n form a group under multiplication called the multiplicative In Mathematics, a prime number (or a prime) is a Natural number which has exactly two distinct natural number Divisors 1 In Modular arithmetic, a branch of Number theory, a primitive root modulo n is any number g with the property that any number Coprime Here is an example of the protocol:
Both Alice and Bob have arrived at the same value, because gab and gba are equal. Note that only a, b and gab = gba are kept secret. All the other values are sent in the clear. Once Alice and Bob compute the shared secret they can use it as an encryption key, known only to them, for sending messages across the same open communications channel. Of course, much larger values of a, b, and p would be needed to make this example secure, since it is easy to try all the possible values of gab mod 23 (there will be, at most, 22 such values, even if a and b are large). If p were a prime of at least 300 digits, and a and b were at least 100 digits long, then even the best algorithms known today could not find a given only g, p, and ga mod p, even using all of mankind's computing power. The problem is known as the discrete logarithm problem. In Mathematics, specifically in Abstract algebra and its applications discrete logarithms are group-theoretic analogues of ordinary Logarithms Note that g need not be large at all, and in practice is usually either 2 or 5.
Here's a more general description of the protocol:
Both Alice and Bob are now in possession of the group element gab, which can serve as the shared secret key. The values of (gb)a and (ga)b are the same because groups are power associative. In Abstract algebra, power associativity is a weak form of Associativity. (See also exponentiation. )
Here is a chart to help simplify who knows what. (Eve is an eavesdropper—she watches what is sent between Alice and Bob, but she does not alter the contents of their communications. Eavesdropping is the act of surreptitiously listening to a private conversation )
Let s = shared secret key. s = 2
Let a = Alice's private key. a = 6
Let b = Bob's private key. b = 15
Let g = public base. g=5
Let p = public (prime) number. p = 23
Note: It should be difficult for Alice to solve for Bob's private key or for Bob to solve for Alice's private key. If it isn't difficult for Alice to solve for Bob's private key (or vice versa), Eve may simply substitute her own private / public key pair, plug Bob's public key into her private key, produce a fake shared secret key, and solve for Bob's private key (and use that to solve for the shared secret key. Eve may attempt to choose a public / private key pair that will make it easy for her to solve for Bob's private key).
The protocol is considered secure against eavesdroppers if G and g are chosen properly. The eavesdropper ("Eve") must solve the Diffie-Hellman problem to obtain gab. The names Alice and Bob are commonly used placeholders for archetypal characters in fields such as Cryptography and Physics. The Diffie-Hellman problem (DHP is the name of a specific problem in Cryptography which was first proposed by Whitfield Diffie and Martin Hellman. This is currently considered difficult. An efficient algorithm to solve the discrete logarithm problem would make it easy to compute a or b and solve the Diffie-Hellman problem, making this and many other public key cryptosystems insecure. In Mathematics, specifically in Abstract algebra and its applications discrete logarithms are group-theoretic analogues of ordinary Logarithms
The order of G should be prime or have a large prime factor to prevent use of the Pohlig-Hellman algorithm to obtain a or b. A group ( G, • is a set G closed under a Binary operation • satisfying the following 3 Axioms: In mathematics the Pohlig–Hellman algorithm is an Algorithm for the computation of Discrete logarithms in a Multiplicative group whose order is a For this reason, a Sophie Germain prime q is sometimes used to calculate p=2q+1, called a safe prime, since the order of G is then only divisible by 2 and q. In Number theory, a Prime number p is a Sophie Germain prime if 2 p  + 1 is also prime A safe prime is a Prime number of the form 2 p + 1 where p is also a prime g is then sometimes chosen to generate the order q subgroup of G, rather than G, so that the Legendre symbol of ga never reveals the low order bit of a. The Legendre symbol or quadratic character is a function introduced by Adrien-Marie Legendre in 1798 during his partly successful attempt to prove the Law of
If Alice and Bob use random number generators whose outputs are not completely random and can be predicted to some extent, then Eve's task is much easier. A random number generator (often abbreviated as RNG is a computational or physical device designed to generate a sequence of Numbers or symbols that lack any
The secret integers a and b are discarded at the end of the session. In Computer science, in particular networking, a session is a semi-permanent interactive information exchange also known as a dialogue a conversation or a meeting Therefore, Diffie-Hellman key exchange by itself trivially achieves perfect forward secrecy because no long-term private keying material exists to be disclosed. In an authenticated Key-agreement protocol that uses Public key cryptography, perfect forward secrecy (or PFS) is the property that ensures that a session
In the original description, the Diffie-Hellman exchange by itself does not provide authentication of the communicating parties and is thus vulnerable to a man-in-the-middle attack. Authentication (from Greek αυθεντικός real or genuine from authentes author is the act of establishing or confirming something (or someone as In Cryptography, the man-in-the-middle attack or bucket-brigade attack (often abbreviated MITM) sometimes Janus attack, is a A person in the middle may establish two distinct Diffie-Hellman key exchanges, one with Alice and the other with Bob, effectively masquerading as Alice to Bob, and vice versa, allowing the attacker to decrypt (and read or store) then re-encrypt the messages passed between them. A method to authenticate the communicating parties to each other is generally needed to prevent this type of attack.
A variety of cryptographic authentication solutions incorporate a Diffie-Hellman exchange. When Alice and Bob have a public key infrastructure, they may digitally sign the agreed key, or ga and gb, as in MQV, STS and the IKE component of the IPsec protocol suite for securing Internet Protocol communications. In Cryptography, a public key infrastructure ( PKI) is an arrangement that binds Public keys with respective user identities by means of a Certificate MQV ( Menezes-Qu-Vanstone) is an authenticated protocol for Key agreement based on the Diffie-Hellman scheme The Station-to-Station (STS protocol is a cryptographic Key agreement scheme based on classic Diffie-Hellman that provides mutual key and entity authentication Internet key exchange ( IKE) is the protocol used to set up a Security association (SA in the IPsec protocol suite Internet Protocol Security ( IPsec) is a suite of protocols for securing Internet Protocol (IP communications by authenticating and/or encrypting The Internet Protocol ( IP) is a protocol used for communicating data across a Packet-switched Internetwork using the Internet Protocol When Alice and Bob share a password, they may use a password-authenticated key agreement form of Diffie-Hellman. In Cryptography, a password-authenticated key agreement method is an interactive method for two or more parties to establish cryptographic keys based on one or more party's knowledge