Section 17.9

A public identity does not add secret entropy

Question

If a key is derived from a secret root and a device address, is the device address part of the secret?

Short answer

No. The device address is public, so it adds no uncertainty for an attacker, and all the secrecy of the derived key comes from the root. For an attacker who knows the address, there are at most as many possible device keys as possible roots. The address has a different job: it makes the key of each device different, so a key extracted from one device does not reveal the keys of the others. Whoever learns the root can compute the key of every device whose address is known.

Terms in the question

Full answer

Step 1: assume that the attacker knows everything public. Cryptography assumes that the attacker knows the algorithms and every non-secret input, and that only keys are secret. This assumption is known as Kerckhoffs’s principle. A device address is not secret: it is broadcast over the radio, printed on labels and recorded by every gateway that hears the device. The attacker is therefore assumed to know it.

Step 2: count the possible keys. Let RR be the root, aa the device address, and Ka=KDF(R,a)K_a = \mathrm{KDF}(R, a) the derived key. For an attacker who knows aa, KaK_a is a fixed function of RR alone: each value of RR gives exactly one value of KaK_a. So KaK_a has at most as many possible values as RR. An attacker can guess the key derived from the most likely root. Whenever that root guess is right, the key guess is right too. If several roots produce the same key, their probabilities add, so another key might be an even better guess. Let H∞(X)H_\infty(X) be the min-entropy of a value XX, and let H∞(Ka∣a)H_\infty(K_a \mid a) be the min-entropy of KaK_a for an attacker who knows aa. Then H∞(Ka∣a)≤H∞(R∣a).H_\infty(K_a \mid a) \le H_\infty(R \mid a). Both sides use what the attacker knows about the address. When the root is generated independently of the address, its distribution is unchanged by learning the address. The length of the output does not change this. A 32-byte string has 22562^{256} possible values, but a derived key takes at most as many values as the root.

Step 3: what the address does contribute. Distinct device addresses give distinct inputs to the derivation. Suppose the KDF behaves as a pseudorandom function §15.1: a keyed function whose outputs look random and unrelated to anyone who does not hold the key. Two random outputs of the chosen length can coincide, but for a long key this is very unlikely for any given pair. Keys derived for different addresses look unrelated to anyone without RR. An attacker who extracts the key of one device from its memory therefore learns nothing useful about the key of another device, or about RR, provided RR has so much min-entropy that guessing it is infeasible. This use of the address is per-device key derivation §5.24.

Step 4: who learns what when something leaks. If the key of one device leaks, that device alone is exposed. If the root leaks, the attacker can compute the key of every device whose address is known, past and future, and because addresses are public, that means every device. The root therefore never goes onto a device. Each device stores only its own derived key, and the root stays with the party that issues the keys.

Step 5: handle the address as a public label. The address is a public input and needs the care that any public input needs.

Step 6: what would make a device input secret. An input adds secrecy only if it is unpredictable and stays secret, for example a random value that the device generates itself and never reveals. A key that depends on such a value stays secret when the root leaks. The cost is that the party that issues keys can no longer recompute that key from the root and the address.

Worked example

The numbers below are deliberately weak, to make the counting visible.

  1. A root with 4 possible values. Suppose the root was chosen uniformly from 4 values, and the attacker knows the KDF and the address C0:11:22:33:44:55. The KDF returns 32 bytes, which is 32×8=25632 \times 8 = 256 bits.

  2. The attacker computes the KDF output for each of the 4 candidate roots, giving at most 4 different keys. Suppose the four outputs for this address are distinct.

  3. The attacker captures one message from the device together with its tag, recomputes the tag with each candidate key, and keeps every candidate whose tag matches. If two candidates pass, another authenticated message can help distinguish them.

  4. The best single guess at the key is right with probability 1/4=2−21/4 = 2^{-2}, so the key has −log2(1/4)=2-\log_2(1/4) = 2 bits of min-entropy, not 256.

A realistic weak root. Suppose the root is a 32-bit number, for example taken from a serial number or a clock reading, and assume that the attacker computes 10610^6 derivations per second on one computer. The root has 232=4,294,967,2962^{32} = 4{,}294{,}967{,}296 possible values, and trying all of them takes 4,294,967,296/106≈42954{,}294{,}967{,}296 / 10^6 \approx 4295 seconds, about 72 minutes. The 32-byte output does not slow this down. With a root of 256 uniformly random bits, the attacker faces 22562^{256} candidates, far more than any computation can try.

A secret address would add little. A Bluetooth public device address consists of 24 bits that the IEEE assigns to the manufacturer, called an organizationally unique identifier (OUI), and 24 bits that the manufacturer assigns to the device. If such an address were kept secret but its OUI were known, the address could take at most 224=16,777,2162^{24} = 16{,}777{,}216 values, and fewer if the manufacturer numbers its devices in order. Together with the 4-value root, the attacker would face at most 4×224=226=67,108,8644 \times 2^{24} = 2^{26} = 67{,}108{,}864 candidates, which take 67,108,864/106≈6767{,}108{,}864 / 10^6 \approx 67 seconds at the rate assumed above. Real addresses are also broadcast and logged, so a design should count the contribution of the address to the secret as zero.

Separation with a strong root. A manufacturer derives keys for 1000 devices from a root of 256 random bits. An attacker opens one device and reads its key. To learn the key of a second device, the attacker still needs the root, which has 22562^{256} possible values, so the keys of the other 1000−1=9991000 - 1 = 999 devices stay unknown.

Follow-up questions and limits

Should the address go into the salt §5.19 or into the info input of HKDF? Into the info input. RFC 5869 defines info as context- and application-specific information, which ties the output to one use; that is the job the address does. The salt is a non-secret, preferably random value used by the extraction step, which turns imperfect secret input into a key that looks uniformly random. Neither input is secret.

Can a derived key reveal the root? Not if the KDF behaves as a pseudorandom function and the root has enough min-entropy: finding the root from a derived key would mean guessing the root. With a weak root, one derived key and its known address are enough to test every candidate root, as the example shows.

What happens after the root leaks? Every derived key must be replaced with keys from a new root. That needs a way to install new keys that the leaked root cannot authorize, such as a separate recovery key §5.31. The entries on the root key and on post-compromise security §5.34 treat this.

This answer covers where the secrecy of a derived key comes from. It does not cover how to store the root or how to choose a KDF.

Fullest treatment: Per-device key derivation (§5.24).

Related entries: Entropy and min-entropy (§5.26), Root key and root seed (§5.25), Post-compromise security (§5.34), Recovery key (§5.31), HKDF (§5.21), Key derivation function (KDF) (§5.20), Public, static random, and private addresses (§7.30), Pseudorandom function (PRF) (§15.1). Further reading: [9, 93].