
- •Contents
- •Preface
- •1 Introduction
- •1.1 Bluetooth system basics
- •1.1.1 Background
- •1.1.2 Trade-offs
- •1.1.3 Bluetooth protocol stack
- •1.1.4 Physical layer
- •1.1.5 Baseband
- •1.1.6 Link manager protocol
- •1.1.7 Logical link control and adaptation protocol
- •1.1.8 Host control interface
- •1.1.9 Profiles
- •1.2 Bluetooth security basics
- •1.2.1 User scenarios
- •1.2.2 Notions and terminology
- •References
- •2.1 Key types
- •2.2 Pairing and user interaction
- •2.3 Authentication
- •2.4 Link privacy
- •2.4.1 Protect the link
- •2.4.2 Encryption algorithm
- •2.4.3 Mode of operation
- •2.4.4 Unicast and broadcast
- •2.5 Communication security policies
- •2.5.1 Security modes
- •2.5.2 Security policy management
- •References
- •3 Bluetooth Pairing and Key Management
- •3.1 Pairing in Bluetooth
- •3.2 HCI protocol
- •3.3 LM protocol
- •3.4 Baseband events
- •3.4.1 Initialization key generation
- •3.4.2 Unit key generation
- •3.4.3 Combination key generation
- •3.4.4 Authentication
- •3.4.5 Master key generation
- •3.5 User interaction
- •3.6 Cipher key generation
- •3.7 Key databases
- •3.7.1 Unit keys generation requirements
- •3.7.2 Combination key generation requirements
- •3.7.3 Key databases
- •3.7.4 Semipermanent keys for temporary use
- •References
- •4 Algorithms
- •4.1 Crypto algorithm selection
- •4.1.1 Block ciphers
- •4.1.2 Stream ciphers
- •4.2 SAFER+
- •4.3 Encryption engine
- •4.4 Ciphering algorithm E0
- •4.4.1 Initialization
- •4.5 Implementation aspects
- •References
- •5 Broadcast Encryption
- •5.1 Overview
- •5.2 Preparing for broadcast encryption
- •5.3 Switching to broadcast encryption
- •References
- •6 Security Policies and Access Control
- •6.1 Objectives
- •6.1.1 Trust relations
- •6.1.2 Security levels
- •6.1.3 Flexibility
- •6.1.4 Implementation considerations
- •6.2 Security manager architecture
- •6.2.1 Overview
- •6.2.2 Device trust level
- •6.2.3 Security level for services
- •6.2.4 Connection setup
- •6.2.5 Database contents and registration procedure
- •Reference
- •7 Attacks, Strengths, and Weaknesses
- •7.1 Eavesdropping
- •7.2 Impersonation
- •7.3 Pairing
- •7.4 Improper key storage
- •7.4.1 Disclosure of keys
- •7.4.2 Tampering with keys
- •7.4.3 Denial of service
- •7.5 Unit key
- •7.6 Location tracking
- •7.6.1 Bluetooth device address and location tracking
- •7.6.2 Five different types of location tracking attacks
- •7.7 Implementation flaws
- •References
- •8 Providing Anonymity
- •8.1 Overview of the anonymity mode
- •8.2 Address usage
- •8.3 Modes of operation
- •8.4 Inquiry and paging
- •8.4.1 Connectable mode
- •8.4.2 Private connectable mode
- •8.4.3 General connectable mode
- •8.5 Alias authentication
- •8.6 Pairing
- •8.7 Anonymity mode LMP commands
- •8.8 Pairing example
- •References
- •9 Key Management Extensions
- •9.1 Improved pairing
- •9.1.1 Requirements on an improved pairing protocol
- •9.1.2 Improved pairing protocol
- •9.1.3 Implementation aspects and complexity
- •9.2 Higher layer key exchange
- •9.2.2 Higher layer key exchange with EAP TLS
- •9.3 Autonomous trust delegation
- •9.3.1 Security group extension method
- •9.3.3 Group extension method versus public key method
- •References
- •10 Security for Bluetooth Applications
- •10.1 Headset
- •10.1.1 Headset security model
- •10.1.2 Pass-key and key management
- •10.1.3 Example
- •10.2 Network access
- •10.2.1 Common access keys
- •10.2.2 Security architecture
- •10.2.3 Network service subscription
- •10.2.4 Initial connection
- •10.2.5 Subsequent access to NAcPs
- •10.3 SIM access
- •10.3.1 The SIM access profile
- •10.3.2 Securing SIM access
- •References
- •Glossary
- •List of Acronyms and Abbreviations
- •About the Authors
- •Index

54 |
Bluetooth Security |
Table 3.1
An Example of Two UTF-8 Encoded Pass-Keys
User-Entered Pass-Key
String (Hexadecimal)
‘0123’ 0x30313233
’Ärlig’ 0xC384726C67
the French AZERTY keyboards). The keyboard itself usually lacks knowledge of what is printed on the key tops. Normally, a scan code is sent to the host, which interprets this code differently depending on the language setting. However, before the keyboard and the computer have been paired, the keyboard must do the interpretation by itself and it has to make some assumptions about the language in order to generate the correct PKEY. Then the best option for the computer is to only use numerical values in its random pass-key string, as the numerical keys tend to have the same scan codes for every language. The computer displays the chosen pass-key string on screen, and then the user enters this number on the keyboard in order to complete the pairing.
3.6 Cipher key generation
When encryption is desired, a ciphering key must be computed. In Bluetooth, the link key is not directly used as the key for the encryption mechanisms. Instead, the ciphering key is determined in several additional steps from the link key and is logically linked to the last authentication that has occurred between two devices through the ACO. In addition, the ciphering key is refreshed for each package that is transmitted. Since we want to explain the ciphering process in its entirety, we will in this section go stepwise through each detail of the ciphering key generation until the final key is fed into the E0 stream cipher.
3.6.1Encryption key KC
Before encryption can commence, the encryption key must be computed. The encryption key KC can be seen as a high-level encryption key from which the other ciphering keys are derived. The value of KC is computed by using the algorithm E3 from the current link key K, a 96-bit ciphering offset (COF), and a 128-bit random number EN_RAND. The value of COF equals the value of the authentication ciphering offset ACO, except when the current link key is a master key. In the latter case, COF is derived from the BD_ADDR of the master as

Bluetooth Pairing and Key Management |
55 |
|
|
|
|
BD _ ADDR ||BD _ ADDR , |
when link is master key |
(3.15) |
COF = |
|
|
ACO |
otherwise |
|
Now KC is given by |
|
|
K C = E 3 (K , EN _ RAND, COF) |
(3.16) |
The ciphering activation always starts with a new computation of KC and is a result of an explicit LM command. As a result, the encryption key is changed every time the encryption is activated. The algorithm E3 is described in more detail in Section 4.2.4.
3.6.2Constraint key K C′
Bluetooth has a key strength constraining mechanism that reduces the 128-bit KC to a 128-bit key whose effective key length may be less than 128 bits. Here, effective key length refers to the number of unknown (bit) combinations in the key. The constraining mechanism was introduced in Bluetooth as a result of export restrictions on encryption hardware. The resulting key is here called the constraint key and is denoted by K C′ . K C′ is determined for a given L by the computation
|
|
|
|
C |
|
|
2 |
|
|
{ |
C |
(x ) |
[ |
|
1 |
]} |
|
||
|
|
|
|
K ′ |
(x) = g L (x ) |
K |
|
mod g L (x ) |
(3.17) |
||||||||||
where K |
C |
= (K |
C, 0 |
, …, |
K |
C, 127 |
), K |
C,i |
|
{0,1} and K ′ |
= (K ′ |
,K, K ′ |
) and K ′ |
||||||
{0,1}, |
|
|
|
|
|
|
|
|
|
|
|
C |
C , 0 |
C ,127 |
C ,i |
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
K C (x ) = ∑127 |
K C ,i x i |
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
i = 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
K |
|
′ (x ) |
= |
127 |
K |
′ |
x i |
|
|
|
||
|
|
|
|
|
|
|
|
C |
|
|
|
∑ |
|
C ,i |
|
|
|
|
i = 0
and (g 1L (x), g 2L (x)) is a pair of polynomials over GF(2), that is, polynomials with coefficients that are elements of the finite field (Galois field) with 2 elements. Since the polynomials KC(x) and K C′ (x) can also be viewed as polynomials over GF(2), the computation in (3.17) is performed using the arithmetic of polynomials over GF(2)2. The modulo computation by g1(x) reduces KC(x) to a polynomial h(x) of a degree less than the degree of g1(x). Thus the effective
2.Mathematicians would say that arithmetic is carried out in GF(2)[x] the ring of polynomials over GF(2).
56 |
Bluetooth Security |
|
|
|
number of unknown keys is reduced to at most 2 |
degree[ g 1 |
( x )] |
. The multiplication |
|
|
|
of h(x) by g2(x) results in a polynomial of a degree less than 128. Yet only 2 degree[ g 1 ( x )] products can occur. Thus, depending on the degree of g1(x), this might be considerably less than 2128, the number of all possible polynomials of degree less than 128. The polynomials g2(x) are chosen with an additional property that guarantees that if two different values of KC result in two different K C′ (x), the number of coefficients in which they differ is at least some given value. The latter value is denoted by Dmin. There are 16 pairs of polynomials
[g 1L (x), g 2L (x)]. Table 3.2 lists the pairs and the DLmin of the resulting constrained key. The effective key length is ≤ 8L.
Although the computations in (3.17) seem to be complicated, they are in fact very easily realized in a hardware circuit using a linear feedback/feedforward shift register with controllable taps. This fact, combined with the slight advantage of the guaranteed differences in the distinct K C′ s, motivated the use of this way of constraining the encryption key.
The effective key length L (number of octets) is established via the encryption key size negotiation. As of Bluetooth version 1.2, there are two supported
|
|
|
Table 3.2 |
|
|
|||
Table of Pairs of Key Constraining Polynomials and D L |
|
Values (Or Upper Limits When Marked with an *) |
||||||
|
|
|
|
min |
|
|
|
|
L |
Deg |
gL |
|
Deg |
gL |
DL |
||
|
|
1 |
|
|
|
|
2 |
min |
1 |
8 |
00000000 00000000 00000000 |
0000011d |
119 |
|
00e275a0 abd218d4 cf928b9b bf6cb08f |
63 |
|
2 |
16 |
00000000 00000000 00000000 |
0001003f |
112 |
|
0001e3f6 3d7659b3 7f18c258 cff6efef |
48 |
|
3 |
24 |
00000000 00000000 00000000 |
010100db |
104 |
|
000001be f66c6c3a b1030a5a 1919808b |
44 |
|
4 |
32 |
00000000 00000000 00000001 |
000000af |
|
96 |
00000001 6ab89969 de17467f d3736ad9 |
32 |
|
5 |
40 |
00000000 00000000 00000100 |
00000039 |
|
88 |
00000000 01630632 91da50ec 55715247 |
32* |
|
6 |
48 |
00000000 00000000 00010000 |
00000291 |
|
77 |
00000000 00002c93 52aa6cc0 54468311 |
27* |
|
7 |
56 |
00000000 00000000 01000000 |
00000095 |
|
71 |
00000000 000000b3 f7fffce2 79f3a073 |
24* |
|
8 |
64 |
00000000 00000001 00000000 |
0000001b |
|
63 |
00000000 00000000 a1ab815b c7ec8025 |
21* |
|
9 |
72 |
00000000 00000100 00000000 |
00000609 |
|
49 |
00000000 00000000 0002c980 11d8b04d |
15* |
|
10 |
80 |
00000000 00010000 00000000 |
00000215 |
|
42 |
|
00000000 00000000 0000058e 24f9a4bb |
14* |
11 |
88 |
00000000 01000000 00000000 |
0000013b |
|
35 |
|
00000000 00000000 0000000c a76024d7 |
11* |
12 |
96 |
00000001 00000000 00000000 |
000000dd |
|
28 |
|
00000000 00000000 00000000 1c9c26d9 |
9* |
13 |
104 |
00000100 00000000 00000000 |
0000049d |
|
21 |
00000000 00000000 00000000 0026d9e3 |
7* |
|
14 |
112 |
00010000 00000000 00000000 |
0000014f |
|
14 |
00000000 00000000 00000000 00004377 |
5* |
|
15 |
120 |
01000000 00000000 00000000 |
000000e7 |
|
7 |
00000000 00000000 00000000 00000089 |
3 |
|
16 |
128 |
1 00000000 00000000 00000000 00000000 |
|
0 |
00000000 00000000 00000000 00000001 |
1 |
||
|
|
|
|
|
|
|
|
|
Note: Polynomials are given via their hexadecimal representation.

Bluetooth Pairing and Key Management |
57 |
|
|
ways of doing this. The new and simple way is for the master to ask the slave what key lengths are supported using a bit vector (see Section 5.2). This is particularly useful in the case of broadcast encryption key negotiation. Alternatively, the master can proceed according to the procedure outlined below.
Each approved Bluetooth device must implement a maximal key size value Lmax, 1 ≤ Lmax ≤ 16. In addition, each Bluetooth application should specify a lower value of L denoted as Lmin. The effective key size L that the two devices A and B will use is determined through a negotiation that tries to find the largest key size that satisfies all the constraints on L between the master and slave devices. The negotiation starts with the master suggesting a length Lsug to a slave that equals the highest possible value for the master. If the constraints at the slave allow this suggested value of L, the suggested value is accepted as the value to be used. If the slave is not allowed to use the suggested value of L, the slave will send its Lmax back to the master. Again, if the master allows this key length it will be used; otherwise, the master proposes the closest acceptable length that is smaller than this. The procedure is repeated with the master and slave alternating proposing the largest remaining key length. This hopefully leads finally to a key length that both master and slave can accept. However, it could be that the constraints are such that no key length exists that meets the size requirements of the slave and the master.
3.6.3Payload key KP
The payload key is the actual key that is used to (de)cipher the (incoming) outgoing packages. The value of KP is computed per packet using the constraint key K C′ , and by a short run for E0 loaded with K C′ , 26 bits of the current clock value, BD_ADDR, and a 128-bit random EN_RAND, Figure 3.6 shows that KP is computed by the algorithm E0 (see Section 4.4). In fact, KP is formed by the state of the 4-bit register in the feedback path of E0 and the last 128 bits of the key stream generated by E0 when initialized with its input data and clocking the
K’C
Clock
E0 |
|
KP |
|
BD_ADDR
EN_RAND
Figure 3.6 Process of generating the payload key KP using the stream cipher algorithm E0.