• 移动安全规范 — 2 -蓝牙安全规范


    1. 蓝牙安全概述

    蓝牙安全模型最初只包括五个不同的安全特性:配对,绑定,设备鉴权,加密和消息完整性,随着版本升级,有如下变化。

    • 2.1+EDR版本引入了安全简易配对(Secure Simple Pairing,SSP),SSP有两个安全目标:防止被动偷听和中间人攻击,man-in-the-middle (MITM) attack(主动偷听)。它使用SHA-256、HMAC-SHA-256和P-192椭圆曲线等算法,并引入四个相关模型:Just Works(直接连接),Numeric Comparison(数值比较,仅用于LE Secure Connections), Passkey Entry(输入密钥) 和 Out-Of-Band(带外,很少用到) ,设备鉴权和加密保持不变。
    • 3.0 + HS版本支持了AMPs。
    • 4.0版本添加了LE的整个安全模型,BR/EDR和AMP安全不变。
    • 4.1版本添加了BR/EDR Secure Connections特性,SSP更新算法P-256椭圆曲线,设备鉴权使用算法HMAC-SHA-256和AES-CTR,Secure Connections添加了消息完整性。
    • 4.2版本添加了LE Secure Connections特性,LE配对更新算法AES-CMAC和P-256 elliptic curve,并改变数值比较关联模型,包括了使用Secure Connections生成密钥的规定。
    • 5.0以上版本增加了传输距离和带宽,安全方面暂未涉及变化。

    2. 蓝牙的安全模式

    我们常常会听到mode 4. level 3, 但对于具体什么是mode 4? 什么是level 3,基于Bluetooth Spec初步关于蓝牙安全的mode和level相关的知识点。

    2.1 Legacy security modes

    包含了一下四种:

    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的蓝牙设备应至少使用以下属性对其服务的安全需求进行分类(按安全性降低的顺序)。

    • Authenticated link key required
    • Unauthenticated link key required
    • Security optional; limited to specific services

     2.2 Legacy security level 

    包含了一下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

    2.3 其他说明

    蓝牙为了兼容不通版本,有一些要求如下: 

    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

    3. 蓝牙的安全认证

    以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 任何时候不允许。 


     


     

  • 相关阅读:
    人工智能之Tensorflow编程模型
    【Flask框架】四. Flask框架之 MySQL数据库操作及项目重构
    JavaSE运算符
    某男子因用本地虚拟机做压测,惨遭字节面试官当场嘲笑
    机器学习笔记:RNN值Teacher Forcing
    嘴笨的技术人员怎么发言
    Redisson
    基于vite3+tauri模拟QQ登录切换窗体|Tauri自定义拖拽|最小/大/关闭
    python树状打印项目路径
    【神策数据面试】手撕题
  • 原文地址:https://blog.csdn.net/qincheng168/article/details/126362068