Chapter 5

Cryptography, authentication, and key lifecycle

This chapter covers the cryptography that protects stored and transmitted data: what each building block guarantees, under which assumptions, and how keys are created, used, replaced and retired. It begins with cryptographic hash functions §5.1 and their three resistance properties, continues with message authentication codes §5.7, with HMAC §5.8 (hash-based message authentication code) as the main example, and with digital signatures §5.14, and then treats authenticated encryption §5.16, which keeps data secret and detects any change to it at the same time. Each entry states the security goal separately from the mechanism, because a correct primitive used for the wrong goal protects nothing.

The middle of the chapter follows a key through its life: deriving keys from a secret with a key derivation function §5.20, producing secrets with enough unpredictability, installing keys in devices, rotating, revoking and recovering them, and limiting the damage when one leaks. Later entries treat implementation hazards, such as timing differences and secrets left in memory, and the questions a design must answer about which bytes a tag covers and what a confirmation proves. The last entries go beyond single messages: Merkle trees §5.43, threshold secret sharing §5.44, anonymity §5.45 and unlinkability §5.46, defenses against traffic analysis §5.47, secure multiparty computation §5.48 and password peppers §5.49. The foundations chapter defines the security properties that these mechanisms serve.

In this chapter

  1. 5.1 Cryptographic hash function
  2. 5.2 SHA-256
  3. 5.3 Preimage resistance
  4. 5.4 Second-preimage resistance
  5. 5.5 Collision resistance
  6. 5.6 Birthday bound
  7. 5.7 Message authentication code (MAC)
  8. 5.8 HMAC
  9. 5.9 HMAC-SHA-256
  10. 5.10 HMAC inner and outer pads
  11. 5.11 Length-extension attack
  12. 5.12 Tag truncation
  13. 5.13 Forgery probability
  14. 5.14 Digital signature
  15. 5.15 Symmetric versus asymmetric cryptography
  16. 5.16 Authenticated encryption (AEAD)
  17. 5.17 AES-CCM
  18. 5.18 Nonce
  19. 5.19 Salt
  20. 5.20 Key derivation function (KDF)
  21. 5.21 HKDF
  22. 5.22 Domain separation
  23. 5.23 Key separation
  24. 5.24 Per-device key derivation
  25. 5.25 Root key and root seed
  26. 5.26 Entropy and min-entropy
  27. 5.27 CSPRNG
  28. 5.28 Key provisioning
  29. 5.29 Key rotation
  30. 5.30 Proof of possession
  31. 5.31 Recovery key
  32. 5.32 Key revocation
  33. 5.33 Forward secrecy
  34. 5.34 Post-compromise security
  35. 5.35 Key compromise impersonation
  36. 5.36 Constant-time cryptographic implementation
  37. 5.37 Secret zeroization
  38. 5.38 Secure element
  39. 5.39 Public measurement key
  40. 5.40 Cryptographic agility
  41. 5.41 Authentication coverage
  42. 5.42 Key confirmation versus application confirmation
  43. 5.43 Merkle trees and authenticated data structures
  44. 5.44 Threshold secret sharing
  45. 5.45 Anonymity
  46. 5.46 Unlinkability
  47. 5.47 Traffic analysis defenses
  48. 5.48 Secure multiparty computation
  49. 5.49 Password pepper: a separate secret, compromise cases, and replacement
  50. 5.50 Post-quantum threat models for embedded authentication