Bluetooth technology has been around for a little while now. I remember back in the day when we used to send each other songs and ringtones over the interface. First thing we had to do is ‘pair the devices‘. But what exactly is pairing bluetooth devices? How does it work?

What is Bluetooth device pairing?

Bluetooth pairing can be thought of as the process of establishing a trusted connection between two bluetooth devices using a numerical password, commonly referred to as a passkey. Depending on how often one Bluetooth device connects to another, the user might opt to have the passkey saved for future connection attempts or prompt to enter the passkey each time the devices request communication with each other.

For two devices to have the ability to pair, they must share the same bluetooth profile. The following is a little excerpt from the official Bluetooth website:

 

How exactly does Bluetooth paring work?

Okay by now we all know how to pair two bluetooth devices, But what is communicated between each device during the pairing process? Apologies to all the nerds in the house, I am about to oversimplify the whole process to a fault. For the sake of the laymen in the house, let us agree to adopt this. Suppose you have two devices; device-A wanting to pair with device-B:

  • A sends a ‘unique key’ to device B on some wavelength/frequency
  • B returns an ‘echo’ back to A, and hence the devices pair.
  • +—–+ key +—–+
  • | | —-> | |
  • | A | | B |
  • | | <—- | |
  • +—–+ echoed +—–+

There are five phases of Secure Simple Pairing:

  1. Public key exchange

+—–+ key +—–+ | | —-> | | | A | | B | | | <—- | | +—–+ echoed +—–+

Each device generates its own Elliptic Curve Diffie-Hellman (ECDH) public-private key pair.

  1. Authentication Stage 1

1 of 3 protocol options is chosen by the connecting devices based on the IO capabilities of the two devices. These are:

  • Numeric Comparison,
  • Out-of-Band,
  • Passkey Entry
  1. Authentication Stage 2

Each device confirms that both devices have successfully completed the exchange as stipulated by which of protocol was chosen and used in the previous step.

  1. Link key calculation

A link key is computed from the derived shared key and the publicly exchanged data. This is the numeric code shown to the user.

  1. LMP Authentication and Encryption

The encryption keys are generated. The devices are successfully connected.

If you haven’t been living under a rock, you know that the headphone jack on smartphones is going the way of the dinosaur, thanks to Apple. More and more OEMs are getting rid of this legacy port on favour of wireless audio. At the moment, Bluetooth headphones are the only viable option. All these bluetooth speakers and headsets require some form of pairing to your audio source to work.

Many smartwatches today rely on Bluetooth to communicate with your phone to offer you the functionality that smartwatches are good for. To connect your phone to your smartwatch, you first need to pair them to your device.