PKI & SSL/TLS

Overview

The fundamental Diffie-Hellman key exchange is susceptible to a Man-in-the-Middle (MITM) attack because it lacks a mechanism for participants to authenticate each other's identity, allowing an attacker to establish two separate secret keys and decrypt all communication. This critical security gap is filled by Public Key Infrastructure (PKI), which introduces trust by using digital certificates signed by a universally trusted third party called a Certificate Authority (CA). Consequently, modern protocols like HTTPS rely on the client's ability to verify the server's certificate signature, ensuring that the initial key exchange and subsequent encrypted communication are indeed with the legitimate intended party.


Key Information


Notes

Creating a certificate with openssl

openssl req -new -nodes -newkey rsa:4096 -keyout key.pem -out cert.csr

Viewing a certificate and its information

openssl x509 -in cert.pem -text


Task

  1. What is the size of the public key in bits?
    1. openssl x509 -in cert.pem -text
    2. Public Key: (4096 bits)
  2. Till which year is this certificate valid?
    1. Not After : Feb 25 11:34:19 2039 GMT
    2. 2039

Conclusion

The inherent lack of identity verification in the basic Diffie-Hellman key exchange leaves it vulnerable to a crippling MITM attack where all communication is compromised. This fundamental flaw is securely mitigated by PKI, which leverages CA-signed digital certificates to authenticate the server's identity, thereby guaranteeing the integrity and confidentiality of modern communication protocols like HTTPS.


Resources



Revision #6
Created 2025-11-25 18:40:18 UTC by David Rizzo
Updated 2025-12-01 16:09:12 UTC by David Rizzo