tanszek:oktatas:techcomm:diffie-hellman_key_exchange
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tanszek:oktatas:techcomm:diffie-hellman_key_exchange [2024/10/07 13:02] – created knehez | tanszek:oktatas:techcomm:diffie-hellman_key_exchange [2024/10/07 13:07] (current) – knehez | ||
---|---|---|---|
Line 9: | Line 9: | ||
2. **Public Parameters**: | 2. **Public Parameters**: | ||
- | * Anna and Berci agree on two public integers, **N** and **g**, where **N** is a large prime number, and **g** is a primitive root modulo **N**. Both of these values are public and can be known to everyone, even potential attackers. | + | * Alice and Bob agree on two public integers, **N** and **g**, where **N** is a large prime number, and **g** is a primitive root modulo **N**. Both of these values are public and can be known to everyone, even potential attackers. |
3. **Exchange of Values**: | 3. **Exchange of Values**: | ||
Line 17: | Line 17: | ||
4. **Shared Key Computation**: | 4. **Shared Key Computation**: | ||
* After receiving each other’s value, Alice computes the **shared secret key** as: | * After receiving each other’s value, Alice computes the **shared secret key** as: | ||
- | \[ | + | |
+ | $$ | ||
M = B^a \mod N = (g^b)^a \mod N = g^{ab} \mod N | M = B^a \mod N = (g^b)^a \mod N = g^{ab} \mod N | ||
- | \] | + | $$ |
* Bob computes the same shared secret key using Alice' | * Bob computes the same shared secret key using Alice' | ||
- | \[ | + | |
+ | \[ | ||
M = A^b \mod N = (g^a)^b \mod N = g^{ab} \mod N | M = A^b \mod N = (g^a)^b \mod N = g^{ab} \mod N | ||
- | \] | + | \] |
* Both end up with the **same value** for \( M \), which becomes the **master key** that they use for their future encrypted communication. | * Both end up with the **same value** for \( M \), which becomes the **master key** that they use for their future encrypted communication. | ||
Line 35: | Line 39: | ||
1. **Alice calculates her value** \( A \): | 1. **Alice calculates her value** \( A \): | ||
- | \[ | + | \[ |
A = g^a \mod N = 3^8 \mod 997 = 6561 \mod 997 = 579 | A = g^a \mod N = 3^8 \mod 997 = 6561 \mod 997 = 579 | ||
- | \] | + | \] |
- | | + | So, Alice sends \( A = 579 \) to Bob. |
2. **Bob calculates his value** \( B \): | 2. **Bob calculates his value** \( B \): | ||
- | \[ | + | \[ |
B = g^b \mod N = 3^{12} \mod 997 = 531441 \mod 997 = 40 | B = g^b \mod N = 3^{12} \mod 997 = 531441 \mod 997 = 40 | ||
- | \] | + | \] |
- | Berci sends \( B = 40 \) to Alice. | + | Bob sends \( B = 40 \) to Alice. |
3. **Alice computes the shared key** \( M \): | 3. **Alice computes the shared key** \( M \): | ||
- | \[ | + | \[ |
M = B^a \mod N = 40^8 \mod 997 = 167772160000 \mod 997 = 887 | M = B^a \mod N = 40^8 \mod 997 = 167772160000 \mod 997 = 887 | ||
- | \] | + | \] |
4. **Bob computes the same shared key** \( M \): | 4. **Bob computes the same shared key** \( M \): | ||
- | \[ | + | \[ |
M = A^b \mod N = 579^{12} \mod 997 = 887 | M = A^b \mod N = 579^{12} \mod 997 = 887 | ||
- | \] | + | \] |
Thus, both Alice and Bob have arrived at the same **shared master key**: **887**. | Thus, both Alice and Bob have arrived at the same **shared master key**: **887**. | ||
Line 66: | Line 70: | ||
The Diffie-Hellman algorithm is foundational in various security protocols, such as TLS (used for secure communication on the Internet) and VPNs (Virtual Private Networks). It ensures that only two parties can generate a shared key that they can compute, even if an attacker monitors the communication channel. | The Diffie-Hellman algorithm is foundational in various security protocols, such as TLS (used for secure communication on the Internet) and VPNs (Virtual Private Networks). It ensures that only two parties can generate a shared key that they can compute, even if an attacker monitors the communication channel. | ||
- | --- | ||
- | |||
- | This explanation adds more details and practical context to the original text, helping your students understand both the mechanics and importance of the Diffie-Hellman key exchange algorithm. Let me know if you need further elaboration! |
tanszek/oktatas/techcomm/diffie-hellman_key_exchange.1728306124.txt.gz · Last modified: 2024/10/07 13:02 by knehez