[DESCRIPTION] in BT2.1 and later versions, the Bluetooth protocol has a new way of simply pairing (simple pairing) in addition to the traditional password pairing (PIN code pairing). This new pairing operation is simpler and more secure. At present, most Bluetooth devices in the market have supported the simple pairing method. From the user's point of view, the traditional PIN code pairing requires both sides of the Bluetooth device to enter the pairing password (if both sides have input devices), and the simple pairing requires both sides to confirm the screen 6-bit random number is the same (if both sides have a screen). The following is a brief description of the simple pairing protocol and the Code flow. [SOLUTION]
1, in the Bluetooth specification, the following figure describes the simple pairing process
A the first line above describes the three pairing processes, namely Bluetooth in Band, OOB Discovery, OOB Discovery and authentication. Here OOB refers to out of the Band, that is, non-Bluetooth transmission, such as NFC.
b The first column on the left from device discovery to authentication is a pairing of four steps, respectively, is the search equipment, establish physical connection, each generated data encryption required link key, authentication (that is, confirm that both link key is correct).
c) Bluetooth in band is the most common Bluetooth pairing method for mobile phones
I. Through inquiry (Bluetooth terminology, the specification defines in detail how to find the surrounding equipment through inquiry operations) to search for surrounding devices,
Ii. to establish a Bluetooth physical connection (ACL link) by using page (like inquiry, which is also a proprietary term)
Iii. the process of generating link key is more in-depth, there is no in-depth discussion, there is interest to study Bluetooth specification Version 4.0–volume 3–part h-security Mana GER Specification
Iv. each of the two sides generated link key, can be identified through three ways: Numeric Compare (6-bit random password comparison), passkey Entry (one side of the display data, the other entered the password), Just works (without discrimination, directly to the Used).
D OOB Discovery only & OOB Discovery and authentication These two ways are to complete some of the steps in the Bluetooth in band by using non-Bluetooth transmission, such as exchanging between two sides via NFC Bluetooth address and link key to achieve a "no pairing" user experience.
2, Mediatek Android's pairing code flow
The following code flow is based on ALPS.JB2.MP, and other versions are similar and can be referenced.