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.