Diffie-hellman Key Exchange

Source: Internet
Author: User

The purpose of this algorithm is to enable two users to securely exchange the key to encrypt the message in the post-order communication, the algorithm itself is limited to the key exchange.

the validity of the Diffie-hellman algorithm is based on the difficulty of computing the discrete logarithm.

Algorithm Description:

1. Select two public integers: Some primitive root α of prime Q and Q .

2, user a Select a random integer xa < q Ya =αxa mod q b Span style= "font-family: the song Body;" > Select the random number x b < q Yb =αxb mod q a and b All to its x y

3. User A calculates ka = (YB) XA mod q, user B calculates kb = (YA) XB mod q. Since Ka = KB, user a and B have completed their key exchange with each other.

    Proof: KA = (YB) XA mod q

= (ΑXB mod q) XA mod q

= (ΑXB) XA mod q

= (αxa) XB mod q

= (αxa mod q) XB mod q

= (YA) XB mod q

= KB

Security:

Since XA and xb are private, attackers can only attack by means of Q,α,Y, and YB, so the discrete logarithm must be obtained to determine the key. That

XB = Dlogα,q (YB)

However, it is very difficult to calculate discrete logarithm, and it is not feasible to find discrete logarithm for large primes. Therefore, the security of the key is ensured.

However, such an agreement does not resist man-in-the- middle attacks .

The attack process is as follows:

1, attacker D randomly generates a private key XD1,xd2, and calculates the public key of the response Yd1,yd2

2,a to communicate with b , to pass YA to b, but by D intercepted and modified to YD1 passed to B.

3 b received the y D1, the y B to a d intercepted, and modified to y D2 to

In fact, in the communication between a and B ,D plays the role of the middleman, actually a and D Communications,D and B Communications, the vulnerability is because the protocol does not certify the parties to the communication. These defects can be overcome by digital signatures and public key certificates.

Diffie-hellman Key Exchange

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.