Section 7.34

Channel confidentiality versus object authenticity

Definition

Channel confidentiality §1.8 is the protection that an encrypted channel, such as an encrypted BLE §7.1 (Bluetooth Low Energy) link, gives data between its two endpoints: an outsider without the channel key can neither read the data nor change it undetected. Object authenticity is a property of the data itself: a tag computed with its author’s key lets the final receiver check who created the data, whatever path it took. The difference: every channel endpoint, a relay included, can read and create traffic, but only the author’s key creates valid objects.

The idea

A publisher prepares a configuration update for a sensor. The update travels over the Internet to a phone, and the phone forwards it over a BLE link to the sensor. The phone has paired with the sensor, so the link is encrypted with keys that only the phone and the sensor hold. When the update arrives, the sensor knows for certain only that the bytes came from the phone. Whether the publisher ever wrote them is a different question, and the link cannot answer it, because the phone could have written any bytes it liked. A phone running malware, a compromised gateway or a stolen phone is exactly the case that matters.

An armored van protects parcels from robbers on the road, but its driver can open a parcel and replace the contents. A seal that only the sender can make protects against everyone who handles the parcel, the driver included. The channel is the van; object authenticity is the seal. The picture stops in two places: a digital seal hides nothing, so anyone can read a signed object unless it is also encrypted; and an intact seal does not show that the parcel is the newest one the sender sent.

The design that follows: the author tags each object before it leaves, the parties that deliver it hold no key that could create a tag, and the device that will act on the object checks the tag itself. Every hop may still be encrypted to keep outsiders out of each link; the tag decides authority.

How it works

The channel. On a BLE link, once pairing §7.17 or a stored bond has provided the long-term key §7.28 (LTK), both devices compute a session key from the LTK and from random values that each contributes. Each packet that is not empty is then encrypted with AES (Advanced Encryption Standard) in an authenticated encryption §5.16 mode and carries a 4-byte MIC (message integrity §1.9 check), and a packet counter in each direction makes a replayed packet fail the check. The MIC covers what a packet carries, not every bit: empty packets have no MIC, and three header bits, which number packets, acknowledge them and announce more data, are left out. An outsider without the key can jam, drop or delay packets and tamper with those uncovered parts, which can lose data or end the connection, but it cannot read the data or change it unnoticed. Each endpoint, however, sees the plaintext and can send any packet, which the other endpoint accepts because it was correctly encrypted with their shared key. A message that crosses several channels, for example the Internet under TLS (Transport Layer Security) and then a BLE link, is decrypted and encrypted again at every relay, and no channel carries the author’s identity across.

The object tag. The author computes a tag over the object’s bytes: a message authentication code §5.7 (MAC), with a secret key that the author shares with the verifier, or a digital signature §5.14, with a private key whose public key the verifier holds. Object and tag travel together through any number of channels and storage places. The verifier, the device that will act on the object, checks the tag with a key it received through a trusted step beforehand, such as at manufacture, and never from the relay. The tag must cover every byte that affects what the device does, a requirement called authentication coverage §5.41. A valid tag shows who made the object, not that it is current, so the device also compares the object’s version with the newest version it has accepted, which provides anti-rollback §8.26, and checks the content.

Who can do what.

An outsider on a link

can disrupt delivery, by jamming, dropping or delaying packets or by tampering with the parts that the MIC does not cover, but cannot read the data or change it unnoticed.

The relay

, an endpoint of the last link that holds no authoring key, can read the object unless the author also encrypted it for the device, drop, delay or reorder it, resend an older valid object, choose which valid objects to deliver, and send invalid data. It cannot make a new object that passes the tag check.

The author

can create any object.

The device

holds the authoring key when the tag is a MAC, and can then create tags too; when the tag is a signature, it holds only the public key and cannot.

Worked example

A publisher P signs configuration objects with Ed25519, a signature scheme with 32-byte public keys and 64-byte signatures. A sensor D holds P’s public key, written into D at manufacture, and the version of the newest object it has accepted: 6. A phone R, paired with D at security level §7.33 4, relays objects and holds the link key and nothing else.

  1. P publishes object X7X_7, 512 bytes with version 7, and its signature. R forwards 512+64=576512 + 64 = 576 bytes. D verifies the signature: valid. Version check: 7>67 > 6. D accepts X7X_7 and records 7.

  2. R changes one byte of X7X_7, a threshold, from 0x32 (50) to 0xFF (255), and sends the result YY with the original signature. The link delivers YY without complaint, because R encrypted it with the correct key. D’s signature check over YY fails, and D rejects YY.

  3. R sends an older object X5X_5 with its genuine signature. The signature is valid, but 5≤75 \le 7, so the version check rejects it; without that check, R could roll D back.

  4. R sends X7X_7 again: valid signature, but 7≤77 \le 7, so D rejects the replay.

  5. P publishes X8X_8 and R never forwards it. D stays at version 7, and no check on D can notice an object that never arrived.

If D accepted any object that arrived on the encrypted link, with no tag check, step 2 would succeed: D would apply YY, and the link encryption would have hidden R’s forgery from everyone else on the way.

The numbers behind the two checks: an outsider who alters the data in a BLE packet without the link key passes the 4-byte integrity check with probability 2−32≈2.3×10−102^{-32} \approx 2.3 \times 10^{-10} per attempt, and a failed check ends the connection; R, who holds the link key, passes it every time. Ed25519 is designed for a strength of about 128 bits: forging a signature is expected to take about 21282^{128} operations, for R as for anyone else without P’s private key.

Stated precisely

Let KchK_{\mathrm{ch}} be the channel key, held by the relay R and the device D. Let sk\mathrm{sk} be the author P’s private signing key, held only by P, and pk\mathrm{pk} the matching public key, installed in D. Write Verify(pk,m,σ)\mathrm{Verify}(\mathrm{pk}, m, \sigma) for the signature check of object mm with signature σ\sigma.

Channel guarantee. The content of every packet that D accepts on the channel was produced in this connection by a holder of KchK_{\mathrm{ch}}, that is, by R, and parties without KchK_{\mathrm{ch}} learn only the packets’ lengths, timing and headers. This assumes that AES and its authenticated encryption mode are secure and that only R and D know KchK_{\mathrm{ch}}. Empty packets and the header bits that the MIC leaves out carry no such guarantee.

Object guarantee. Assume that the signature scheme meets the standard requirement called existential unforgeability under chosen-message attack (EUF-CMA): an attacker without sk\mathrm{sk}, even after obtaining signatures on objects of its choice, cannot feasibly produce any pair (m,σ)(m, \sigma) with Verify(pk,m,σ)=accept\mathrm{Verify}(\mathrm{pk}, m, \sigma) = \text{accept} for an mm that P never signed. Then every object D accepts was signed by P at some time, provided that only P holds sk\mathrm{sk}; pk\mathrm{pk} reached D through a step that R cannot influence or undo; the signed bytes cover everything that affects D’s behavior, encoded so that different contents never give the same bytes; and D acts on exactly the bytes it verified. The guarantee says “signed by P at some time”, not “now”, “newest” or “delivered”.

With a MAC. Replace sk\mathrm{sk} and pk\mathrm{pk} by one secret key KobjK_{\mathrm{obj}} held by P and D. The guarantee becomes: every accepted object was tagged by a holder of KobjK_{\mathrm{obj}}. D is such a holder, and so is every other device that shares KobjK_{\mathrm{obj}}, so a separate key per device stops a key extracted from one device from forging objects for the others. Holding KchK_{\mathrm{ch}} gives no power over KobjK_{\mathrm{obj}} when the two are independent random keys, as key separation §5.23 requires.

Limits and common mistakes

Object authenticity gives no confidentiality. The relay reads every object unless the author also encrypts it for the device, which gives end-to-end security §1.34 for the content.

Object authenticity gives no freshness and no availability §1.10. The relay can resend old valid objects, which only a version check or another freshness check §1.26 stops, and can drop or delay any object without the device noticing.

A valid object can still be harmful. A tag shows who made the object, not that its content is safe to apply, so the device still checks the content.

Giving the relay the authoring key removes the separation. A MAC key built into a phone application, for example, lets anyone who extracts it author objects.

A strong last hop authenticates the relay, not the author. Security level 4 on the BLE link means only that the link key was made without a man-in-the-middle §7.26.

The check must run on the device that acts. A check done by the relay or by a gateway protects nothing against that relay, and a verification key that arrives over the relay’s channel lets the relay choose the key. Verification also costs the device time, so a relay that floods it with invalid objects calls for a limit on how much it verifies.

Questions answered

Can a paired relay fabricate a new valid application object?

No, a paired relay cannot fabricate a new valid application object when two conditions hold. First, each object carries a tag, a message authentication code (MAC) or a digital signature, made with an authoring key that the relay does not hold. Second, the device checks that tag over exactly the bytes it acts on, with a key it obtained earlier and not from the relay. Pairing gives the relay only the link key, with which it can read and send traffic on that one BLE (Bluetooth Low Energy) link; the link key brings it no closer to creating a valid tag.

The relay can still read the object unless it is also encrypted for the device, drop or delay it, and resend older objects with their valid tags; a version check stops the resends. If the device trusts whatever arrives over the encrypted link, with no object tag, the answer is yes: the relay can send any object it likes, and the device cannot tell it from the author’s. The answer is also yes if the relay holds the authoring key, for example a MAC key built into a phone application.

Related entries: Message authentication code (MAC) (§5.7), Digital signature (§5.14), Authentication coverage (§5.41), Key separation (§5.23), Long-term key (LTK) (§7.28), End-to-end security (§1.34), Authenticity versus authorship (§1.38), Rollback versus anti-rollback (§8.26). Further reading: [93, 168].