蓝牙安全模型最初只包括五个不同的安全特性:配对,绑定,设备鉴权,加密和消息完整性,随着版本升级,有如下变化。
我们常常会听到mode 4. level 3, 但对于具体什么是mode 4? 什么是level 3,基于Bluetooth Spec初步关于蓝牙安全的mode和level相关的知识点。
包含了一下四种:
Security mode 1 (non-secure):当对端的设备为Security mode1时,就不需要做任何的加密的行为.
Security mode 2 (service level enforced security):当对端设备为security mode 2,就需要做service level的安全化(也就是加密),什么是service level?可以理解为是再L2CAP 之上的安全化(加密),对于建立L2CAP之前的ACL和LMP是不需要加密的
Security mode 3 (link level enforced security):当对端的设备为Security mode3时, 需要在发起LMP_SETUP_COMPLETE之前就需要启动安全流程
Security mode 4 (service level enforced security):处于Security mode 4的蓝牙设备应至少使用以下属性对其服务的安全需求进行分类(按安全性降低的顺序)。
包含了一下5种
Level 4:for services with the following attributes:
MITM protection required
128-bit equivalent strength for link and encryption keys required using FIPS
approved algorithms (E0 not allowed, SAFER+ not allowed, and P-192 not
allowed; encryption key not shortened)
User interaction acceptable
Level 3:for services with the following attributes:
MITM protection required
Encryption required
At least 56-bit equivalent strength for encryption key should be used
User interaction acceptable
Level 2:for services with the following attributes:
MITM protection not required
Encryption required
At least 56-bit equivalent strength for encryption key should be used
Level 1:for services with the following attributes:
MITM protection not required
At least 56-bit equivalent strength for encryption key when encryption is
enabled should be used
Minimal user interaction desired
Level 0: Service requires the following:
MITM protection not required
No encryption required
No user interaction required
蓝牙为了兼容不通版本,有一些要求如下:
security mode 2 for backwards compatibility with remote devices that do not support Secure Simple Pairing(security mode 2是对于不支持SSP的蓝牙设备)
security mode 4 for devices that support Secure Simple Pairing(security mode 4是对于支持SSP的设备)
SSP对应的association models(交互模型)中,numeric comparison, out-of-band, or passkey entry使用的是“Authenticated link key required”,而“just works Secure Simple Pairing association model“对应的是"Unauthenticated link key required"
An unauthenticated link key does not have protection against MITM attacks.
更详细的说明请看: Bluetooth Core Specification v5.2 -> Host -> Part C: Generic Access Profile -> 5 Security aspects - BR/EDR physical transport -> Securtiy modes
以PCI 安全认证为例子,讲述蓝牙安全认证的一些明确定义的规范。
对于BR/EDR蓝牙,在2.1-4.0的版本必须 使用Mode 4 Level 3; 在4.1或以上版本必须使用Mode 4 Level 4。Mode 1、Mode 2 和Mode 4 of Just Works 任何时候不允许。
对于BLE蓝牙, 由于没有ssp模式,必须使用4.2或以上版本且使用Mode 1 Level 4。Mode 2、Mode 4 of Just Works and level 1,2,3 任何时候不允许。