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
Key derivation: computing a key with a key derivation function §5.20 (KDF), an algorithm §14.1 that takes a secret input key and non-secret context values and returns new keys. The same inputs always give the same output. A common KDF is built from a hash-based message authentication code §5.8 (HMAC) and is called the HMAC-based Extract-and-Expand Key Derivation Function §5.21 (HKDF); RFC 5869 defines it.
Secret root: a root key §5.25, which is a secret value from which other keys are derived. The party that issues the keys, such as the manufacturer, keeps it.
Device address: an identifier of one device on a network. A Bluetooth device address §7.30, for example, is 48 bits long, and a Bluetooth Low Energy (BLE) §7.1 device normally includes its address in the advertising packets it broadcasts, where any receiver nearby can read it.
Part of the secret: an input adds to the secret only if the attacker can neither learn it nor guess it. Unpredictability is measured by min-entropy §5.26: if the attacker’s best single guess at a value is right with probability , the value has bits of min-entropy.
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 be the root, the device address, and the derived key. For an attacker who knows , is a fixed function of alone: each value of gives exactly one value of . So has at most as many possible values as . 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 be the min-entropy of a value , and let be the min-entropy of for an attacker who knows . Then 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 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 . An attacker who extracts the key of one device from its memory therefore learns nothing useful about the key of another device, or about , provided 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.
Encode the address without ambiguity, together with a label that names the purpose of the key. In HKDF the place for both is the input called info, which RFC 5869 defines for context- and application-specific information. Give the address a fixed length, such as 6 bytes for a Bluetooth device address, so that no two pairs of label and address produce the same bytes.
Do not treat a claimed address as proof of identity, because anyone can send any address. A device proves its identity by showing that it holds , for example by computing a valid tag with .
Derive a key only for an address whose key the requester is entitled to. A service that returns for any address it is sent hands out the key of every device.
Derive from an address that does not change. Many BLE devices use private addresses that change over time, and a key derived from such an address would change with it; derive from the stable identity address instead. Two devices that share an address also share a key.
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.
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 bits.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.
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.
The best single guess at the key is right with probability , so the key has 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 derivations per second on one computer. The root has possible values, and trying all of them takes seconds, about 72 minutes. The 32-byte output does not slow this down. With a root of 256 uniformly random bits, the attacker faces 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 values, and fewer if the manufacturer numbers its devices in order. Together with the 4-value root, the attacker would face at most candidates, which take 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 possible values, so the keys of the other 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].