Definition
An actor, key-derivation and authentication §1.6 diagram is a figure that shows four things: the parties of a system, called actors; the secret keys each actor holds; how each key is computed from a root secret by a key derivation function §5.20 (KDF), an algorithm §14.1 that turns one secret into further keys; and where a receiver checks a message authentication code §5.7 (MAC), a short tag over a message that only a holder of a given key can compute. The diagram is read by tracing each check back to its key.
Where it fits
Main entry: Domain separation (§5.22).
The domain separation entry explains a rule that such a diagram must show: every purpose of a key gets its own input to the KDF, so that no key or tag made for one purpose is valid for another. In the diagram that input is the context string on a derivation arrow: a non-secret byte string, fed to the KDF together with the secret, that names the purpose and often also the device, the protocol version and the direction of traffic. RFC 5869, which defines a widely used KDF [9], calls this input info. A diagram might show and , where is the root secret, the secret from which all keys are derived, is the device identifier and joins two byte strings. Keyed with a secret root that is uniformly random, meaning that every value is equally likely, a standard KDF behaves as a pseudorandom function §15.1, whose outputs look random and unrelated to anyone without the key. The key then reveals nothing about , provided the two inputs differ as byte strings.
To read the diagram, start at each point where a tag is checked and follow the arrows backward.
Name the key that the check uses.
Follow the derivation arrows from that key to the root secret.
List every actor that holds that key or any secret above it on the path to the root. Each of them can compute a valid tag.
With a MAC, the receiver that checks a tag holds the same key as the sender, so a valid tag proves only that some holder of the key made it, not which holder. Proof that one named party made a message needs a digital signature §5.14, for which only the signer holds the private signing key.
The diagram should also tell apart two kinds of authentication. Transport authentication protects the bytes on one link, such as an encrypted radio connection, for as long as that connection lasts; each relay at which the connection ends sees the content and could change it. Artifact authentication is a tag computed over the content itself, such as an update file, so the tag can still be checked after any number of relays and storage steps. Each arrow that crosses a trust boundary §1.3, a point where data passes from a less trusted part to a more trusted part, should show which of the two protects it. All keys and labels in this entry’s examples are invented.
Limits and common mistakes
A context string adds no secrecy. Whoever learns the root secret can derive every key below it, whatever the labels are.
The labels inside a derivation are separate from what a tag covers. The authenticated message must still include the fields that the authentication coverage §5.41 entry lists, such as the receiver’s identity, the operation and a counter.
A valid MAC does not show that a message is fresh rather than replayed, that its sender may make the request, or that its content stayed secret. Those need a replay check, an authorization §1.7 decision and encryption.
An arrow in a diagram is a claim. Whether a program feeds exactly these bytes to the KDF has to be checked in the program itself.
Questions answered
Why do context strings matter?
Context strings matter because they make the input of a key derivation different for every purpose, so that a key, or a tag made with it, for one purpose is never valid for another. A context string is a non-secret label, such as update or telemetry, that is fed together with a root secret into a key derivation function (KDF), an algorithm that turns one secret into further keys. This use of labels is called domain separation.
Suppose a device derives one key for checking software updates and another for checking sensor reports, and a data-analysis service receives only the reporting key so that it can check reports. With distinct labels the two keys are unrelated, so the analysis service cannot produce a valid tag for an update. Without labels, both derivations receive only the same root secret and device identifier and so yield the same key, and the analysis service could make a malicious update pass the device’s check.
The labels must also be encoded without ambiguity. Joined directly, the fields ab and c give the same bytes as the fields a and bc. With a length prefix §4.30, one byte before each field that states the field’s length, the two give the different byte sequences 02 61 62 01 63 and 01 61 02 62 63, written in hexadecimal, where 61, 62 and 63 are the letters a, b and c.
Related entries: Key derivation function (KDF) (§5.20), Message authentication code (MAC) (§5.7), Authentication coverage (§5.41), Per-device key derivation (§5.24), Key separation (§5.23), Digital signature (§5.14), Trust boundary (§1.3), Length-prefix framing (§4.30), Pseudorandom function (PRF) (§15.1). Further reading: [9].