词条 | Diffie–Hellman key exchange | ||||||||||||||||||||||||||||||||||||||
释义 |
}} Diffie–Hellman key exchange (DH)[1] is a method of securely exchanging cryptographic keys over a public channel and was one of the first public-key protocols as originally conceptualized by Ralph Merkle and named after Whitfield Diffie and Martin Hellman.[2][3] DH is one of the earliest practical examples of public key exchange implemented within the field of cryptography. Traditionally, secure encrypted communication between two parties required that they first exchange keys by some secure physical channel, such as paper key lists transported by a trusted courier. The Diffie–Hellman key exchange method allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure channel. This key can then be used to encrypt subsequent communications using a symmetric key cipher. Diffie–Hellman is used to secure a variety of Internet services. However, research published in October 2015 suggests that the parameters in use for many DH Internet applications at that time are not strong enough to prevent compromise by very well-funded attackers, such as the security services of large governments.[4] The scheme was first published by Whitfield Diffie and Martin Hellman in 1976,[3] but in 1997 it was revealed that James H. Ellis,[4] Clifford Cocks, and Malcolm J. Williamson of GCHQ, the British signals intelligence agency, had previously, in 1969,[5] shown how public-key cryptography could be achieved.[6] Although Diffie–Hellman key agreement itself is a non-authenticated key-agreement protocol, it provides the basis for a variety of authenticated protocols, and is used to provide forward secrecy in Transport Layer Security's ephemeral modes (referred to as EDH or DHE depending on the cipher suite). The method was followed shortly afterwards by RSA, an implementation of public-key cryptography using asymmetric algorithms. {{US patent|4,200,770}}, from 1977, is now expired and describes the now-public-domain algorithm. It credits Hellman, Diffie, and Merkle as inventorsNameIn 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), writing: The system...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.[7] DescriptionGeneral overviewDiffie–Hellman key exchange establishes a shared secret between two parties that can be used for secret communication for exchanging data over a public network. The conceptual diagram to the right illustrates the general idea of the key exchange by using colors instead of very large numbers. The process begins by having the two parties, Alice and Bob, agree on an arbitrary starting color that does not need to be kept secret (but should be different every time[4]); in this example, the color is yellow. Each of them selects a secret color that they keep to themselves – in this case, red and blue-green. The crucial part of the process is that Alice and Bob each mix their own secret color together with their mutually shared color, resulting in orange-tan and light-blue mixtures respectively, and then publicly exchange the two mixed colors. Finally, each of the two mixes the color they received from the partner with their own private color. The result is a final color mixture (yellow-brown in this case) that is identical to the partner's final color mixture. If a third party listened to the exchange, it would only know the common color (yellow) and the first mixed colors (orange-tan and light-blue), but it would be computationally difficult for this party to determine the final secret color (yellow-brown). In fact, when using large numbers rather than colors, this action is computationally expensive: It is impossible to do in a reasonable amount of time even for modern supercomputers. Cryptographic explanationThe simplest and the original implementation[3] of the protocol uses the multiplicative group of integers modulo p, where p is prime, and g is a primitive root modulo p. These two values are chosen in this way to ensure that the resulting shared secret can take on any value from 1 to p–1. Here is an example of the protocol, with non-secret values in blue, and secret values in red.
Both Alice and Bob have arrived at the same value s, because, under mod p, [8] More specifically, Note that only a, b, and (gab mod p = gba mod p) are kept secret. All the other values – p, g, ga mod p, and gb mod p – 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 there are only 23 possible results of n mod 23. However, if p is a prime of at least 600 digits, then even the fastest modern computers cannot find a given only g, p and ga mod p. Such a problem is called the discrete logarithm problem.[4] The computation of ga mod p is known as modular exponentiation and can be done efficiently even for large numbers. Note that g need not be large at all, and in practice is usually a small integer (like 2, 3, ...). Secrecy chartThe chart below depicts who knows what, again with non-secret values in blue, and secret values in red. Here Eve is an eavesdropper – she watches what is sent between Alice and Bob, but she does not alter the contents of their communications.
Now s is the shared secret key and it is known to both Alice and Bob, but not to Eve. 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 is not 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). Another demonstration of Diffie–Hellman (also using numbers too small for practical use) is given here.[9] Generalization to finite cyclic groupsHere is a more general description of the protocol:[10]
Both Alice and Bob are now in possession of the group element gab, which can serve as the shared secret key. The group G satisfies the requisite condition for secure communication if there is not an efficient algorithm for determining gab given g, ga, and gb. For example, the elliptic curve Diffie–Hellman protocol is a variant that uses elliptic curves instead of the multiplicative group of integers modulo p. Variants using hyperelliptic curves have also been proposed. The supersingular isogeny key exchange is a Diffie–Hellman variant that has been designed to be secure against quantum computers. Operation with more than two partiesDiffie–Hellman key agreement is not limited to negotiating a key shared by only two participants. Any number of users can take part in an agreement by performing iterations of the agreement protocol and exchanging intermediate data (which does not itself need to be kept secret). For example, Alice, Bob, and Carol could participate in a Diffie–Hellman agreement as follows, with all operations taken to be modulo p:
An eavesdropper has been able to see ga, gb, gc, gab, gac, and gbc, but cannot use any combination of these to efficiently reproduce gabc. To extend this mechanism to larger groups, two basic principles must be followed:
These principles leave open various options for choosing in which order participants contribute to keys. The simplest and most obvious solution is to arrange the N participants in a circle and have N keys rotate around the circle, until eventually every key has been contributed to by all N participants (ending with its owner) and each participant has contributed to N keys (ending with their own). However, this requires that every participant perform N modular exponentiations. By choosing a more optimal order, and relying on the fact that keys can be duplicated, it is possible to reduce the number of modular exponentiations performed by each participant to {{math|log2(N) + 1}} using a divide-and-conquer-style approach, given here for eight participants:
Once this operation has been completed all participants will possess the secret gabcdefgh, but each participant will have performed only four modular exponentiations, rather than the eight implied by a simple circular arrangement. SecurityThe protocol is considered secure against eavesdroppers if G and g are chosen properly. In particular, the order of the group G must be large, particularly if the same group is used for large amounts of traffic. The eavesdropper ("Eve") has to solve the Diffie–Hellman problem to obtain gab. This is currently considered difficult for groups whose order is large enough. 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. Fields of small characteristic may be less secure.[11] The order of G should have a large prime factor to prevent use of the Pohlig–Hellman algorithm to obtain a or b. For this reason, a Sophie Germain prime q is sometimes used to calculate {{nowrap|1=p = 2q + 1}}, called a safe prime, since the order of G is then only divisible by 2 and q. 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. A protocol using such a choice is for example IKEv2.[12] g is often a small integer such as 2. Because of the random self-reducibility of the discrete logarithm problem a small g is equally secure as any other generator of the same group. 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. 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. Mallory (an active attacker executing the man-in-the-middle attack) may establish two distinct key exchanges, one with Alice and the other with Bob, effectively masquerading as Alice to Bob, and vice versa, allowing her to decrypt, then re-encrypt, the messages passed between them. Note that Mallory must continue to be in the middle, transferring messages every time Alice and Bob communicate. If she is ever absent, her previous presence is then revealed to Alice and Bob. They will know that all of their private conversations had been intercepted and decoded by someone in the channel. A method to authenticate the communicating parties to each other is generally needed to prevent this type of attack. Variants of Diffie–Hellman, such as STS protocol, may be used instead to avoid these types of attacks. Practical attacks on Internet trafficThe number field sieve algorithm, which is generally the most effective in solving the discrete logarithm problem, consists of four computational steps. The first three steps only depend on the order of the group G, not on the specific number whose finite log is desired.[13] It turns out that much Internet traffic uses one of a handful of groups that are of order 1024 bits or less.[4] By precomputing the first three steps of the number field sieve for the most common groups, an attacker need only carry out the last step, which is much less computationally expensive than the first three steps, to obtain a specific logarithm. The Logjam attack used this vulnerability to compromise a variety of Internet services that allowed the use of groups whose order was a 512-bit prime number, so called export grade. The authors needed several thousand CPU cores for a week to precompute data for a single 512-bit prime. Once that was done, individual logarithms could be solved in about a minute using two 18-core Intel Xeon CPUs.[4] As estimated by the authors behind the Logjam attack, the much more difficult precomputation needed to solve the discrete log problem for a 1024-bit prime would cost on the order of $100 million, well within the budget of large national intelligence agency such as the U.S. National Security Agency (NSA). The Logjam authors speculate that precomputation against widely reused 1024-bit DH primes is behind claims in leaked NSA documents that NSA is able to break much of current cryptography.[4] To avoid these vulnerabilities, authors recommend use of elliptic curve cryptography, for which no similar attack is known. Failing that, they recommend that the order, p, of the Diffie–Hellman group should be at least 2048 bits. They estimate that the pre-computation required for a 2048-bit prime is 109 more difficult than for 1024-bit primes.[14] Other usesEncryptionPublic key encryption schemes based on the Diffie–Hellman key exchange have been proposed. The first such scheme is the ElGamal encryption. A more modern variant is the Integrated Encryption Scheme. Forward secrecyProtocols that achieve forward secrecy generate new key pairs for each session and discard them at the end of the session. The Diffie–Hellman key exchange is a frequent choice for such protocols, because of its fast key generation. Password-authenticated key agreementWhen Alice and Bob share a password, they may use a password-authenticated key agreement (PK) form of Diffie–Hellman to prevent man-in-the-middle attacks. One simple scheme is to compare the hash of s concatenated with the password calculated independently on both ends of channel. A feature of these schemes is that an attacker can only test one specific password on each iteration with the other party, and so the system provides good security with relatively weak passwords. This approach is described in ITU-T Recommendation X.1035, which is used by the G.hn home networking standard. An example of such a protocol is the Secure Remote Password protocol. Public keyIt is also possible to use Diffie–Hellman as part of a public key infrastructure, allowing Bob to encrypt a message so that only Alice will be able to decrypt it, with no prior communication between them other than Bob having trusted knowledge of Alice's public key. Alice's public key is . To send her a message, Bob chooses a random b and then sends Alice (unencrypted) together with the message encrypted with symmetric key . Only Alice can determine the symmetric key and hence decrypt the message because only she has a (the private key). A pre-shared public key also prevents man-in-the-middle attacks. In practice, Diffie–Hellman is not used in this way, with RSA being the dominant public key algorithm. This is largely for historical and commercial reasons{{citation needed|date=November 2015}}, namely that RSA Security created a certificate authority for key signing that became Verisign. Diffie–Hellman cannot be used to sign certificates. However, the ElGamal and DSA signature algorithms are mathematically related to it, as well as MQV, STS and the IKE component of the IPsec protocol suite for securing Internet Protocol communications. See also
Notes1. ^Synonyms of Diffie–Hellman key exchange include* Diffie–Hellman–Merkle key exchange* Diffie–Hellman key agreement* Diffie–Hellman key establishment* Diffie–Hellman key negotiation* Exponential key exchange* Diffie–Hellman protocol* Diffie–Hellman handshake 2. ^{{cite journal|last1=Merkle|first1=Ralph C.|date=April 1978|title=Secure Communications Over Insecure Channels|url=|journal=Communications of the ACM|volume=21|issue=4|pages=294–299|doi=10.1145/359460.359473|quote=Received August, 1975; revised September 1977|via=|citeseerx=10.1.1.364.5157}} 3. ^1 2 {{Cite journal|last1=Diffie|first1=Whitfield|last2=Hellman|first2=Martin E.|authorlink2=Martin Hellman|date=November 1976|title=New Directions in Cryptography|url=//ee.stanford.edu/%7Ehellman/publications/24.pdf|deadurl=no|journal=IEEE Transactions on Information Theory|volume=22|issue=6|pages=644–654|doi=10.1109/TIT.1976.1055638|archiveurl=https://web.archive.org/web/20141129035850/https://ee.stanford.edu/%7Ehellman/publications/24.pdf|archivedate=2014-11-29|via=|authorlink1=Whitfield Diffie|citeseerx=10.1.1.37.9720}} 4. ^{{cite web|url=http://cryptocellar.web.cern.ch/cryptocellar/cesg/possnse.pdf|title=The possibility of Non-Secret digital encryption|last1=Ellis|first1=J. H.|authorlink=James H. Ellis|date=January 1970|work=CESG Research Report|archiveurl=https://web.archive.org/web/20141030210530/https://cryptocellar.web.cern.ch/cryptocellar/cesg/possnse.pdf|archivedate=2014-10-30|deadurl=yes|access-date=2015-08-28}} 5. ^{{cite web|url=https://www.gchq.gov.uk/sites/default/files/document_files/CESG_Research_Report_No_3006_0.pdf|title=The Possibility of Secure Non-Secret Digital Encryption|last=|first=|date=|website=|archiveurl=https://web.archive.org/web/20170216051636/https://www.gchq.gov.uk/sites/default/files/document_files/CESG_Research_Report_No_3006_0.pdf|archivedate=2017-02-16|deadurl=no|accessdate=2017-07-08|df=}} 6. ^{{cite news|url=https://www.bbc.co.uk/news/uk-england-gloucestershire-11475101|title=GCHQ trio recognised for key to secure shopping online|last=|first=|date=5 October 2010|work=BBC News|accessdate=5 August 2014|archiveurl=https://web.archive.org/web/20140810044800/http://www.bbc.co.uk/news/uk-england-gloucestershire-11475101|archivedate=10 August 2014|deadurl=no}} 7. ^{{citation | last1=Hellman | first1=Martin E. | title=An overview of public key cryptography | journal=IEEE Communications Magazine | volume=40 | issue=5 | pages=42–49 | date=May 2002 | doi=10.1109/MCOM.2002.1006971 | url=http://www-ee.stanford.edu/~hellman/publications/31.pdf | deadurl=no | archiveurl=https://web.archive.org/web/20160402093741/http://www-ee.stanford.edu/%7Ehellman/publications/31.pdf | archivedate=2016-04-02 | df= | citeseerx=10.1.1.127.2652 }} 8. ^{{citation | first1=F. | last1=Garzia | title=Handbook of Communications Security | page=182 | publisher=WIT Press | date=2013 | isbn=978-1845647681 | url=https://books.google.com/books?id=F-KBlLnllSoC&pg=PA182 }} 9. ^{{citation | first1=Bill | last1=Buchanan | title=Diffie–Hellman Example in ASP.NET | work=Bill's Security Tips | url=http://buchananweb.co.uk/security02.aspx | accessdate=2015-08-27 | deadurl=no | archiveurl=http://archive.wikiwix.com/cache/20110827202606/http://buchananweb.co.uk/security02.aspx | archivedate=2011-08-27 | df= }} 10. ^{{Cite book|url=https://books.google.com/books?id=BuQlBQAAQBAJ&pg=PA190#v=onepage&q&f=false|title=Introduction to Cryptography|last=Buchmann|first=Johannes A.|publisher=Springer Science+Business Media|year=2013|isbn=978-1-4419-9003-7|edition=Second|location=|pages=190–191}} 11. ^{{cite conference | first1=Razvan | last1=Barbulescu | first2=Pierrick | last2=Gaudry | first3=Antoine | last3=Joux | first4=Emmanuel | last4=Thomé | title=A Heuristic Quasi-Polynomial Algorithm for Discrete Logarithm in Finite Fields of Small Characteristic | work=Lecture Notes in Computer Science | book-title=Advances in Cryptology – EUROCRYPT 2014 | conference=Proceedings 33rd Annual International Conference on the Theory and Applications of Cryptographic Techniques | location=Copenhagen, Denmark | volume=8441 | date=2014 | pages=1–16 | doi=10.1007/978-3-642-55220-5_1 | isbn=978-3-642-55220-5 }} 12. ^{{Cite news |title=RFC 4306 Internet Key Exchange (IKEv2) Protocol |publisher=Internet Engineering Task Force (IETF) |author=C. Kaufman (Microsoft) |date=December 2005 |url=http://www.ietf.org/rfc/rfc4306.txt |deadurl=no |archiveurl=https://web.archive.org/web/20150107073645/http://www.ietf.org/rfc/rfc4306.txt |archivedate=2015-01-07 |df= }} 13. ^Whitfield Diffie, Paul C. Van Oorschot, and Michael J. Wiener "Authentication and Authenticated Key Exchanges", in Designs, Codes and Cryptography, 2, 107–125 (1992), Section 5.2, available as Appendix B to {{US patent|5724425}} 14. ^1 2 3 4 5 6 {{cite web|url=https://weakdh.org/imperfect-forward-secrecy-ccs15.pdf|title=Imperfect Forward Secrecy: How Diffie–Hellman Fails in Practice|last1=Adrian|first1=David|last2=Bhargavan|first2=Karthikeyan|date=October 2015|website=|archive-url=|archive-date=|dead-url=|access-date=|last3=Durumeric|first3=Zakir|last4=Gaudry|first4=Pierrick|last5=Green|first5=Matthew|last6=Halderman|first6=J. Alex|last7=Heninger|first7=Nadia|last8=Springall|first8=Drew|last9=Thomé|first9=Emmanuel|display-authors=1|last10=Valenta|first10=Luke|last11=VanderSloot|first11=Benjamin|last12=Wustrow|first12=Eric|last13=Zanella-Béguelin|first13=Santiago|last14=Zimmermann|first14=Paul}} ReferencesGeneral references
External links{{External links|date=March 2016}}
2 : Key-agreement protocols|Public-key cryptography |
||||||||||||||||||||||||||||||||||||||
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。