How does Bluetooth pairing work?
Solution 1
Bluetooth Secure Simple Pairing uses Elliptic Curve Diffie Hellman (ECDH) public key cryptography with approximately 95 bits of entropy using the FIPS approved P192 elliptic curve.
E:y2=x3 +ax+b(modp)
The following parameters are given:
- The prime modulus p, order r, base point x-coordinate Gx, base point y- coordinate Gy.
-
The integers p and r are given in decimal form; bit strings and field elements are given in hex.
p = 6277101735386680763835789423207666416083908700390324961279 r = 6277101735386680763835789423176059013767194773182842284081 b = 64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1 Gx = 188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012 Gy = 07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811
There are five phases of Secure Simple Pairing:
1. Public key exchange
Each device generates its own Elliptic Curve Diffie-Hellman (ECDH) public-private key pair.
2. 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
3. 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.
4. 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.
5. LMP Authentication and Encryption
The encryption keys are generated. The devices are successfully connected.
Further Reading:
- Bluetooth user Interface Flow Diagrams for Bluetooth Secure Simple Pairing Devices (PDF)
-
Bluetooth Core Complete Specification v4.0 vol0 (ZIP/PDF)
the core specification is 138 pages and to fully answer your question would take at least 20 so to fully answer your question you'll need to read the references
Solution 2
A trusted relationship is established between the 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.
Read more : http://www.ehow.com/how-does_4964578_bluetooth-pairing-work.html
For two devices to have the ability to pair, they must share the same bluetooth profile. The following is from the official Bluetooth website:
Pairing devices
Not all Bluetooth enabled devices are designed to be paired. Logically, there's no reason to connect a wireless mouse to a wireless headset. You should be able to pair a Bluetooth enabled headset to a Bluetooth enabled phone, or a Bluetooth enabled mouse to a Bluetooth enabled computer.
If you're not sure whether the two devices you want to connect are designed to be paired with each other, make sure their Bluetooth profiles match.
Related videos on Youtube
![jbutler483](https://i.stack.imgur.com/Km6Of.png?s=256&g=1)
jbutler483
I stream on Twitch - and sometimes stream modding! Profiles NewCodepen |Old Codepen | butlers-web | Facebook Contact contact @ butlers-web . co . uk (no spaces) Private Message Prefer to Chat?
Updated on December 22, 2020Comments
-
jbutler483 over 3 years
How exactly does Bluetooth paring work? What is communicated between each device during the pairing process?
I was told if you had 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 +-----+
This seems to be inaccurate, so would anyone be able to either expand further or actually explain how/what is communicated to result in a successful pairing of the devices?
I was thinking of incorporating some of this research into a final year project (University), but would at least need to know the something of the Bluetooth programming pairing first.
Any help would be much appreciated in describing how these initial communications work.
I've heard of terms such as 'parked mode', and 'passive mode' within my research, but am yet to find any 'useful' information in the programming behind the design, (and hence I have asked this question). The likes of googling this type of topic is also quite difficult as it seems to bring up stuff like 'how to turn your bluetooth on' pages, and not the design of the programming behind it.
-
kaylum over 9 yearsYour question is just so broad I find it difficult to answer. Do you want to know the RF level? The link control level? The higher level protocols? All? But I do have a recommendation for a pretty good book that covers all of these in great detail. It was published in 2002 so doesn't cover Bluetooth Low Energy. But it does cover the fundamental BT operation from the RF level up. "Bluetooth Operation and Use" by Robert Morrow.
-
jbutler483 over 9 yearsthank you! This is much alike to what I was looking for, and your links are most helpful. Cheers.
-
davidcondrey over 9 yearsIf you search around for further information, Google with the query
site:bluetooth.org