NivaarExam PrepOfficial exam papers ↗

19-Soft-B3 Security · December 2016

Question 2 of 7: Public-Key Communication, the Certificate Authority, and Diffie–Hellman vs. RSA

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

National Exams, December 2016 — 04-Soft-B3, Security/Safety (closed book, 3 hours, no calculator). FIVE of the seven questions constitute a complete paper (the first five as answered in the answer book are marked, each of equal value); this solution answers all seven as a full study resource. Most questions call for essay-format answers; clarity and organisation of the answer are important. Question 6 asks for a security analysis of a short C program.

Reference texts. Stallings & Brown, Computer Security: Principles and Practice, 4th ed., Ch. 2–3 (Cryptographic Tools, One-Time Pad, Stream/Block Ciphers), Ch. 21 (Public-Key Infrastructure, Certificate Authorities), Ch. 10 (Key Management, Diffie–Hellman, RSA), Ch. 3 (Hash Functions, MAC), Ch. 23 (Digital Signatures), Ch. 3 & 24 (User Authentication, Two-Factor, SSO), Ch. 9 (Firewalls, DMZ), Ch. 8 (Intrusion Detection, Honeypots), Ch. 10 (Buffer Overflow), Ch. 1 (Security Concepts — CIA Triad); Anderson, Security Engineering, 3rd ed., Ch. 4 (Access Control), Ch. 1 (Security Concepts).

Question 2: Public-Key Communication, the Certificate Authority, and Diffie–Hellman vs. RSA (20 marks)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

Part a) — both parties already have a public/private key pair. With each side already holding a public/private key pair, they can communicate securely with public-key (asymmetric) cryptography directly: the sender encrypts a message with the recipient's public key, so only the holder of the matching private key can decrypt it, and/or signs it with their own private key so the recipient can verify the sender's identity and that the message was not altered. Because asymmetric operations are computationally expensive for bulk data, real systems use a hybrid scheme: the public keys authenticate each other and establish a fresh, random symmetric session key (e.g. via a signed key exchange), and all subsequent traffic is protected with a faster symmetric cipher (Question 1) — the approach used by TLS/HTTPS.

Part b) — the certificate authority. A certificate authority (CA) is a trusted third party that verifies an entity's identity and then issues a digital certificate binding that identity to its public key, signing the certificate with the CA's own private key. Anyone who trusts the CA and holds its public key can verify the certificate's signature and thereby trust that the enclosed public key really belongs to the named party, without ever having had prior contact with that party. This directly prevents a man-in-the-middle (impersonation) attack: without a CA, an attacker sitting between the two parties could substitute their own public key while claiming to be the other party, silently intercepting and re-encrypting all "secure" traffic; because the attacker cannot forge a CA signature over a certificate binding the victim's identity to the attacker's key, a client that checks the certificate against a trusted CA rejects the substituted key.

Part c) — Diffie–Hellman versus RSA for establishing a shared key. Advantage of Diffie–Hellman: DH provides forward secrecy when fresh (ephemeral) private exponents $a, b$ are generated for each session — if a long-term key is later compromised, past session keys derived from discarded ephemeral values cannot be recovered, whereas with RSA key transport the session key is encrypted directly under the recipient's long-term public key, so compromise of that one long-term private key retroactively exposes every session key ever sent to it (no forward secrecy). Disadvantage of Diffie–Hellman: basic DH provides no authentication of the parties by itself (Question 1's public-key certificates must be layered on top to prevent a man-in-the-middle attack against the exchange), and it requires an interactive, two-way exchange of values before a shared key exists; RSA key transport can be one-way — the sender simply encrypts a chosen session key under the recipient's already-known public key and sends it, without needing the recipient to compute and return anything first.