NDC & PKI
[Day 4] 2. Diffie-Hellman Key Exchange
D
DITISS AdminAlgorithm to Generate Symmetric Key at Both Ends
The Diffie-Hellman Key Exchange algorithm is commonly used to establish a shared symmetric key between two parties over an insecure channel. Here's how it works:
Setup
Imagine Tinku and Pinki want to securely exchange a symmetric key.
- Both agree on two public values:
- Prime Number : 23
p - Base : 5
g
- Prime Number
Step 1: Secret Integers
- Tinku selects a private secret integer : 6
a - Pinki selects a private secret integer : 15
b
Step 2: Compute Public Values
-
Tinku calculates:
A = g ^ a mod pA = 5 ^ 6 mod 23 = 8 -
Pinki calculates:
B = g ^ b mod pB = 5 ^ 15 mod 23 = 19
Step 3: Exchange Public Values
- Tinku sends A (8) to Pinki.
- Pinki sends B (19) to Tinku.
Step 4: Compute Shared Secret Key
-
Tinku calculates the shared key
:s
s = B ^ a mod ps = 19 ^ 6 mod 23 = 2 -
Pinki calculates the shared key
:s
s = A ^ b mod p
s = 8 ^ 15 mod 23 = 2
Result
- Both Tinku and Pinki have independently computed the same shared symmetric key: .
2 - This symmetric key can now be used for secure communication.
Key Points
- Confidentiality: The secret integers (and
a) are never transmitted, ensuring that the shared key is secure.b - Shared Key: The same symmetric key (in this example) is derived independently by both parties.
2 - Scalability: This method allows secure key exchanges without requiring prior secure communication.
Read Next
8/26/2026
[Day 4] 3. Network Configuration Scenario
You have three machines with different network adapter configurations: 1. **Machine 1** is connected to **VMNET4**. 2. **Machine 2** has two netwo...
8/26/2026
[Day 4] 4. Remote Machine Monitoring (Nagios)
#### **NCPA Plugin** To monitor a remote machine (Windows), we'll use the Nagios plugin **NCPA** (Nagios Cross Platform Agent) in a Windows VM, whi...