◇ OpenCyber Academy
Professional · Chapter 4 · English

Chapter 4 — Cryptography and trust services: core methods

Open, free learning for anyone who wants to protect people and technology. No account is required to read this text or its worked answers.

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

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) →