Chapter 4 — Cryptography and trust services: core methods
Lesson map
Lesson 04 published. Map, example, EX016.
flowchart TD
N0["Learning outcomes"]
N1["4.1 Four building blocks"]
N2["4.2 Certificates and chains"]
N3["4.3 Matching method to need"]
N4["Synthesis"]
N0 --> N1 --> N2 --> N3 --> N4
N4 --> EX["Worked example"]
EX --> Q["Exercise EX016"]
Logical drawing
flowchart LR
N0["Learning outcomes"]
N1["4.1 Four building blocks"]
N2["4.2 Certificates and chains"]
N3["4.3 Matching method to need"]
N4["Synthesis"]
N0 --> N1 --> N2 --> N3 --> N4 --> Q["EX016"]
[Learning outcomes]
|
v
[4.1 Four building blocks]
|
v
[4.2 Certificates and chains]
|
v
[4.3 Matching method to need]
|
v
[Synthesis]
|
v
[Worked example] --> [Exercise EX016]
Learning outcomes
You will (1) explain symmetric encryption, hashing, MACs and signatures in practitioner terms; (2) explain certificates and chains; (3) choose the right method for a client need.
4.1 Four building blocks
Marcus summarises the building blocks. Symmetric encryption, such as AES in GCM mode from NIST SP 800-38D, uses one key to encrypt and decrypt and also detects tampering. A hash, such as SHA-256 from FIPS 180-4, gives a fixed fingerprint of data that anyone can compute. A message authentication code, such as HMAC, needs a shared key and proves a message came from someone holding it. A digital signature, such as Ed25519 from RFC 8032 or ECDSA from FIPS 186-5, uses a private key to sign and a public key to verify, so anyone can check it without being able to sign.
4.2 Certificates and chains
A certificate, defined in RFC 5280, binds a name such as book.bayside.example to a public key and is signed by a certificate authority. Browsers trust a small set of root authorities; roots sign intermediates, and intermediates sign server certificates. A browser verifies the chain from the server certificate up to a trusted root, checks the name and the validity dates, and only then proceeds. Dana learns that most certificate problems she will see are not broken mathematics but operational issues: expired dates, missing intermediates, wrong names or a private key stored where too many people can read it.
4.3 Matching method to need
Dana practises with Bayside needs. Protecting the booking form in transit calls for TLS. Detecting if a nightly export file was corrupted calls for a hash, with the expected value delivered separately. Proving that payment notifications came from the processor calls for an HMAC with a shared secret, or a signature if the processor publishes a public key. Letting patients verify a signed treatment plan PDF calls for a signature. Protecting a backup at rest calls for authenticated encryption with the key held apart from the backup. Getting the match right is the core skill of the practitioner.
Worked example
Dana fills a table of six Bayside needs, choosing TLS, hash, HMAC, signature or authenticated encryption for each and naming who holds the key.
Synthetic case. Needs and hostnames are synthetic; the cited standards are real.
Errors and limits
Real systems combine methods; TLS itself uses all four blocks. A hash without a trusted reference value proves nothing about tampering.
Exercises
- EX016 — MAC versus signature. Why can a MAC verifier forge tags while a signature verifier cannot? Rubric: 3 = signature verifiers cannot forge, because they hold only the public key; MAC verifiers hold the same key and could create tags;; 2 = key asymmetry;; 1 = no difference;; 0 = none.
- EX017 — Chain order. Describe the chain a browser verifies for the booking site. Rubric: 3 = server certificate signed by intermediate signed by trusted root, plus name and dates;; 2 = partial chain;; 1 = no chain;; 0 = none.
- EX018 — Typical problems. What kind of certificate problems will Dana mostly meet? Rubric: 3 = operational: expiry, missing intermediates, wrong names, exposed keys;; 2 = two;; 1 = broken maths;; 0 = none.
- EX019 — Backup method. Which method protects a backup at rest, and where should the key be? Rubric: 3 = authenticated encryption with the key held apart from the backup;; 2 = method;; 1 = hash;; 0 = none.
- EX020 — Signed treatment plan. Which method lets patients verify a treatment plan PDF came from Bayside? Rubric: 3 = digital signature verified with a public key;; 2 = signature;; 1 = encryption;; 0 = none.
Synthesis
Choosing among encryption, hashes, MACs, signatures and certificates by need is the practitioner's central cryptographic skill.
Continue studying — chapter 04 of 12
← Chapter 03 (draft) · Course chapter index · Chapter 05 (draft) →