In Bluetooth LE, what is the difference between pairing and bonding, and which keys does a bond keep for reconnecting without pairing again?
answer
- one is a procedure, one is storage
- three phases, the last optional
- a 128-bit key encrypts reconnections
- a second key resolves private addresses
basics
~20 sPairing is the Security Manager procedure that authenticates the devices and creates keys to encrypt the link; bonding stores those keys so later connections re-encrypt without pairing. A bond keeps the Long Term Key and, if distributed, the Identity Resolving Key.
solid answer
~30 sPairing is the Security Manager procedure in three phases: the pairing feature exchange (IO capabilities, OOB flag, bonding, MITM and Secure Connections flags, key size), key generation, and an optional transport-specific key distribution on the now encrypted link. Bonding is the choice, signalled in the Bonding_Flags of the authentication requirements, to store the results. What is kept is the Long Term Key (LTK), which encrypts reconnections, and the Identity Resolving Key (IRK), which resolves private addresses, together with the identity address. Without bonding the keys serve one connection only.
go deeper
Recall that pairing creates keys and bonding keeps them, and name the LTK and IRK as what a bond holds.
Explain the three phases, which phase generates the LTK in Secure Connections, and why a distributed key inherits the pairing's security properties.
Describe the reconnection-failure policy for bonded and unbonded pairs and how cross-transport derivation must not overwrite a stronger key.
Decide which keys a product persists, for how long, and what a factory reset or a transfer of ownership must erase.
## Pairing is a procedure, bonding is storage **Pairing** is what the Security Manager (Core Specification Vol 3 Part H) does the first time two LE devices meet: it exchanges capabilities, authenticates the peers to a degree that depends on the chosen association model, and generates a key that encrypts the link. **Bonding** is a separate decision: keep the keys and the peer's identity so that the next connection can be encrypted at once instead of pairing again. The initiator and responder each state in the Bonding_Flags field of the authentication requirements whether they want a bond (`00` is No Bonding, `01` is Bonding). ## The three phases 1. **Phase 1, pairing feature exchange.** The Pairing Request and Pairing Response carry the IO Capability, the OOB data flag, the authentication requirements (Bonding_Flags, the MITM flag, the SC flag, the keypress flag and the CT2 flag), the maximum encryption key size (7 to 16 octets) and which keys each side will distribute. 2. **Phase 2, key generation.** Legacy pairing derives a Short Term Key (STK) from a Temporary Key (TK); LE Secure Connections runs an elliptic-curve Diffie-Hellman exchange on P-256 and generates the Long Term Key (LTK) directly. 3. **Phase 3, key distribution.** Optional, and performed only on a link that is already encrypted with the phase 2 key. This is where the bond's remaining contents travel. Phases 1 and 3 look the same whichever association model phase 2 used. ## What the bond keeps | Item | Purpose | Legacy pairing | LE Secure Connections | |---|---|---|---| | LTK | Encrypts the link on every reconnection | Distributed by the Peripheral (and optionally the Central), identified by EDIV and Rand | Generated in phase 2; EDIV and Rand are zero; not distributed | | IRK | Generates and resolves private addresses | Distributed | Distributed | | Identity address | Names the peer behind a private address | Sent with the IRK | Sent with the IRK | - The LTK is shortened (masked) to the negotiated encryption key size; the IRK is not. - Every distributed key inherits the security properties of the key that carried it. A Just Works pairing therefore produces an unauthenticated bond, and no later step upgrades it. - A received identity address is trusted only after a reconnection has succeeded with that address and the LTK. - Before Core 6.3 a third key, the CSRK, was distributed for data signing. The 6.3 Security Manager has no occurrence of it because data signing was removed in 6.3. ## Why bonding is a policy choice - Without bonding the phase 2 key still encrypts the current connection, but the next connection must pair again. - A sensor that is paired once and reconnects daily wants a bond; a shared device that meets many phones may choose not to store them. - Stored keys make the device's key storage part of its security. The Core text says a distributed key is only as strong as the algorithms inside the device that generated it, that it must carry 128 bits of entropy, and that it must not be generated only from information visible outside the Peripheral. ## Key size Each device holds a maximum and a minimum encryption key length between 7 and 16 octets. The shorter of the two maxima is used, and each side checks the result against its own minimum, ending pairing with the Pairing Failed reason Encryption Key Size if it is too short. A key shorter than 16 octets is masked after generation and before it is distributed, used or stored; the IRK is exempt. ## Dual-mode devices When both ends support Secure Connections on one transport, they may derive a key of identical strength and the same MITM property for the other transport (cross-transport key derivation). The conversion uses the AES-CMAC based functions h6 and h7; h7 is used only when both devices set the CT2 flag. The Generic Access Profile forbids deriving a key over an existing stronger one. ## What a reviewer asks - Is bonding requested, and what security properties does the stored key carry? - What happens when a bonded peer reconnects and encryption fails because the other side deleted its keys? For a bonded pair the Security Manager text says to notify the user of a security failure, not to re-pair silently. - Are the IRK and LTK stored with the pairing's security properties, so a later service check can compare them?
- A bonded peripheral reconnects but the central has deleted its stored keys. What should the peripheral side do?The Security Manager text distinguishes by security properties and bonding. For a bonded pair, whichever properties the key had, the device notifies the user of a security failure instead of re-pairing on its own. Only for a pair that is not bonded may it start pairing automatically (recommended for unauthenticated keys) or ask the user first (recommended for authenticated keys).
- Why does a Secure Connections bond contain no distributed LTK, and what travels in key distribution instead?The LTK is generated in phase 2 by both sides from the ECDH result, so each side already holds it and EDIV and Rand are set to zero. Phase 3 then carries at most the IRK and the identity address, over the link just encrypted with that LTK.
- Treats pairing and bonding as the same thing.
- Says the bond stores the passkey the user typed.
- Believes a Just Works bond can be upgraded to authenticated later.
- Thinks Secure Connections still distributes the LTK in phase 3.
- Says the IRK is shortened to the negotiated encryption key size.
Assumes Core 6.3. LE Secure Connections (Core 4.2) generates the LTK instead of distributing it; the CSRK is absent from the 6.3 Security Manager because data signing was removed in 6.3.