Docsity

Diffie-Hellman Key Exchange: A Comprehensive Guide with Exercises and Explanations, Exams of Social Sciences

Toggle sidebar
bg1
DIFFIE AND HELLMAN KEY EXCHANGE
Diffie and Hellman key exchange - Answers :-The first published public-key algorithm
appeared
in the seminal paper by Diffie and Hellman.
-It is a public-key cryptography for key distribution
only.
- Used in number of commercial products.
- The purpose of the algorithm is to enable two users to securely exchange a key that
can then be used for subsequent symmetric encryption of messages.
-The algorithm itself is limited to the exchange of secret values.
-It is a public-key distribution scheme:
-which cannot be used to exchange an arbitrary
message
-rather it can establish a common key
-known only to the two participants
-value of key depends on the participants.
All users agree on global parameters:
-large prime integer or polynomial q a being a primitive root mod q
-each user (eg. A) generates their key
*chooses a secret key (number): xA< q
- compute their public key: yA^xA = α mod q
*each user makes public that key yA
Algorithm - Answers :Shared session key for users A & B is KAB:
For B:
K = y_Ax_B mod q
= α x_A.x_B mod q = α x_B.x_A mod q
= y x_A mod q
For A:
K_AB = y x_A mod q
=α x_B.x_A mod q
= α x_A.x_B mod q
= x_A.x_B mod q
pf3
pf4
pf5

Partial preview of the text

Download Diffie-Hellman Key Exchange: A Comprehensive Guide with Exercises and Explanations and more Exams Social Sciences in PDF only on Docsity!

DIFFIE AND HELLMAN KEY EXCHANGE

Diffie and Hellman key exchange - Answers :-The first published public-key algorithm appeared in the seminal paper by Diffie and Hellman.

  • It is a public-key cryptography for key distribution only.
  • Used in number of commercial products.
  • The purpose of the algorithm is to enable two users to securely exchange a key that can then be used for subsequent symmetric encryption of messages.
  • The algorithm itself is limited to the exchange of secret values.
  • It is a public-key distribution scheme:
    • which cannot be used to exchange an arbitrary message
    • rather it can establish a common key
    • known only to the two participants
  • value of key depends on the participants. All users agree on global parameters:
  • large prime integer or polynomial q a being a primitive root mod q
  • each user (eg. A) generates their key *chooses a secret key (number): xA< q
  • compute their public key: yA^xA = α mod q *each user makes public that key yA Algorithm - Answers :Shared session key for users A & B is KAB: For B: K = y_Ax_B mod q = α x_A.x_B mod q = α x_B.x_A mod q = y x_A mod q For A: K_AB = y x_A mod q =α x_B.x_A mod q = α x_A.x_B mod q = x_A.x_B mod q

K_AB is used as session key (or pre-key) in private-key encryption scheme between sender and receiver. If sender and receiver subsequently communicate, they will have the same key as before, unless they choose new public-keys (can use nonce and pre-key to make session key different). Attacker needs a private key x, must solve discrete log base α modulo q to get it Primitive Root - Answers :A ______________ of a prime number p is one whose powers modulo p generate all the integers from 1 to p - 1. That is, if a is a ______________ of the prime number p, then the numbers a mod p,a^2 mod p, ...., a^p-1 mod p are distinct and consist of the integers from 1 through p - 1 in some permutation. a^φ(p) mod p ≡ 1 i.e. a^p-1 mod p ≡ 1

  • Answers :-An adversary only has the following ingredients to work with: q, α, YA, and YB.
  • Thus, the adversary is forced to take a discrete logarithm to determine the key.
  • For example, to determine the private key of user B, an adversary must compute y_B = α^xB mod q: x_B = dlog α , q(y_B)
  • The adversary can then calculate the key K in the same manner as user B calculates it.
  • That is, the adversary can calculate K as: K = y x_B mod q
  • The security of the Diffie-Hellman key exchange lies in the fact that, while it is relatively easy to calculate exponentials modulo a prime, it is very difficult to calculate discrete logarithms. This is called as discrete logarithm problem.
  • For large primes, Diffie-Hellman is very secure. Man-in-the-Middle Attack - Answers :Darth prepares by creating two private / public keys Alice transmits her public key to Bob Darth intercepts this and transmits his first public key to Bob. Darth also calculates a shared key with Alice
  • If, Darth simply wants to eavesdrop on the communication, Darth sends Bob E(K1, M) without altering M.
  • Instead, If Darth wants to modify the message, Darth sends Bob E(K1, M'), where M' is any message. Defense against Man-in-the-Middle Attack - Answers :- The key exchange protocol is vulnerable to "Man-in-the- Middle" attack because it does not authenticate the participants.
  • This vulnerability can be overcome with the use of digital signatures and public-key certificates. Suppose that two parties A and B wish to setup a common secret key (D-H key) between themselves using the Diffie-Hellman key exchange technique. They agree on 7 as the modulus and 3 as the primitive root. Party A chooses 2 and party B chooses 5 as their respective secrets. Their D-H key is______. - Answers :4 (Ya = 3^2mod 7 = 2 Yb = 3^5 mod 7 = 5 K = 2^5mod 7 = 4 Or K = 5^2 mod 7 = 4) The security of Diffie-Hellman key exchange relies on which assumption? - Answers :It is computationally infeasible to solve the discrete log problem. Describe the Diffie - Hellman protocol / key exchange - Answers :1. Alice choose a prime q and finds a primitive root g
  1. Alice choose a random number, x, from 1 to q - 2 and send Bob: g - the primitive root q - the prime X hat - g^x mod q
  2. Bob chooses a random number Y from 1 to q - 2 and sends: Y hat = g^y mod q
  3. Alice and Bob both compute the key, g^(xy) mod q, or k
  • Alice computes Y hat ^ x
  • Bob computes X hat ^ y
  1. They use the key, k as their private key. *** Even if Eve knows g^x and g^y, she can't figure out g^(xy) since g^y * g^x = g^(x+y) What type of math does even need to compute to find xy? - Answers :Eve must be able to compute the discrete logarithm, which is very hard to do

What is the Decisional Diffie - Hellman assumption?Is the assumption true? - Answers :Fro every prime p and primitive root mod p, the following two distributions are computationally indistinguishable Diffie-Hellman, where x, y are random <g^x, g^y, g^xy> Truly random distribution <g^x, g^y, g^z> No, if x is even, then g^x is a quadratic residue and can eliminate half the keys What is the Man in the Middle attack and how does it break the Diffie-Hellman key exchange? - Answers :Eve impersonates as both Alice and Bob. The set-up with Eve in the middle:

  1. Alice sends g^x to Bob
  2. Eve intercepts and actually sends g^v to Bob
  3. Bob sends g^y to Alice
  4. Eve intercepts and actually sends g^w to Alice. The private key between Alice and Eve is now g^(xw) and the private key between Bob and Eve is g^(vy) What are other problems that can happen with the Diffie-Hellman key exchange? - Answers :1. How do we know p is prime and g is a primitive root?
  5. What is Eve replaces g^x with 1?
  6. What is Eve replaces g^x with an element of small order? What is a safe prime? - Answers :p = 2q + 1 where q is a prime it is safe due to its relation with strong primes, where a strong prime is that q + 1 and q - 1 has a relatively large prime What are 2 hard problems in number theory? - Answers :1. Factorization Pr[Alg finds factorization of a random n-bit int] < e(n)
  7. Discrete Logarithm Pr[give g^x and g for a random primitive root mod p and random X theres an alg that finds X] < e(logp) log(p) since we keep dividing large number in half?

Step 3 of DH each user computes the others equation to complete shared secret - Answers :Step 3 of DH each user ____ the others ____ to complete ____ ____ Step 4 of DH secret integers discarded - Answers :Step 4 of DH secret ____ ____ man in the middle attacks - Answers :What is DH vulnerable to? password authentication - Answers :What helps make DH less vulnerable to attacks? TLS - Answers :What protocol uses DH? asymmetric - Answers :Is DH symmetric or asymmetric?