背景介绍

针对传统蓝牙的产品, 提到安全等级时我们常常会听到mode 4. level 3, 但对于具体什么是mode 4? 什么是level 3却一知半解.
而本文会基于Bluetooth Spec初步关于蓝牙安全的mode和level相关的知识点.

BR/EDR(传统蓝牙) 中的Security modes


如上图所示,在security channel 建立过程会根据Responding device version(对端设备)的蓝牙版本来选择Security Mode, 这点也说明了一个设备为了兼任旧版本的蓝牙可能会存在多个Security mode. 需要注意的是:

  1. security mode 2 for backwards compatibility with remote devices that do not support Secure Simple Pairing(security mode 2是对于不支持SSP的蓝牙设备)
  2. security mode 4 for devices that support Secure Simple Pairing(security mode 4是对于支持SSP的设备)

需要补充一点的是: 有些同学可能会不理解Security mode的意思,关于这一点我们暂时可以将Security mode理解为蓝牙协议中对于安全级别的划分或模式的划分,不同的Secutiy mode会有对应的不同动作.

Legacy security modes(引用于Bluetooth Spec, 也希望大家能通过BT Spec进行蓝牙协议的学习)

Legacy security modes apply to those devices with a Controller or a Host that does not support SSP.
而 Legacy security modes 包含了如下三种:

  1. Security mode 1 (non-secure)
  2. Security mode 2 (service level enforced security)
  3. Security mode 3 (link level enforced security)
Security mode 1 (non-secure)

当对端的设备为Security mode1时,就不需要做任何的加密的行为

Security mode 2 (service level enforced security)

当对端设备为security mode 2,就需要做service level的安全化(也就是加密),有些同学可能会疑问?什么是service level?在Bluetooth Spec中有如下小段的描述:

When a remote Bluetooth device is in security mode 2 it will not initiate any
security procedure before a channel establishment request
(L2CAP_ConnectReq) has been received or a channel establishment
procedure has been initiated by itself

也就是service level enforced security可以理解为是再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
    这里需要注意的是:
  1. 对于传统蓝牙,Security mode 4 是对于支持 Secure Simple Pairing(SSP)的设备.
  2. 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"
  3. 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

BR/EDR(传统蓝牙)中提到的level

我们在BR/EDR中常常听到的mode 4, level 3中的level是针对security mode 4而言的,在前面的文章中提到了Securtiy mode 4有几种安全等级分类,也就是这里对应的Level * ,可以理解为进一步的规范定义.

  • 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

【蓝牙开发】Bluetooth Security 中的Security modes相关推荐

  1. iOS蓝牙开发---CoreBluetooth[BLE 4.0] 初级篇[内附Demo地址]

    一.蓝牙基础知识 (一)常见简称 1.MFI  make for ipad ,iphone, itouch 专们为苹果设备制作的设备,开发使用ExternalAccessory 框架(认证流程貌似挺复 ...

  2. springsecurity sessionregistry session共享_要学就学透彻!Spring Security 中 CSRF 防御源码解析...

    今日干货 刚刚发表查看:66666回复:666 公众号后台回复 ssm,免费获取松哥纯手敲的 SSM 框架学习干货. 上篇文章松哥和大家聊了什么是 CSRF 攻击,以及 CSRF 攻击要如何防御.主要 ...

  3. 如何使用Java和XML Config在Spring Security中启用HTTP基本身份验证

    在上一篇文章中,我向您展示了如何在Java应用程序中启用Spring安全性 ,今天我们将讨论如何使用Spring Security 在Java Web应用程序中启用Basic HTTP身份验证 . 如 ...

  4. Spring Security中HttpSecurity常用方法及说明

    本文来说下spring security中HttpSecurity常用方法,这个类在spring security中使用的非常多,功能十分丰富,其中包含的方法也是非常多,在实际的开发中,需要重写里面的 ...

  5. 要学就学透彻!Spring Security 中 CSRF 防御源码解析

    上篇文章松哥和大家聊了什么是 CSRF 攻击,以及 CSRF 攻击要如何防御.主要和大家聊了 Spring Security 中处理该问题的几种办法. 今天松哥来和大家简单的看一下 Spring Se ...

  6. Android Bluetooth蓝牙开发\蓝牙协议\蓝牙通信例子_Android支持蓝牙4.0版本_BLE开发

    一.Android Bluetooth现状 在android官网可以了解到android4.2新增了部分新功能,但是对于BT熟悉的人或许开始头疼了,那就是Android4.2引入了一个新的蓝牙协议栈针 ...

  7. Spring Security入门到实践(一)HTTP Basic在Spring Security中的应用原理浅析

    一.Spring Security简介 打开Spring Security的官网,从其首页的预览上就可以看见如下文字: Spring Security is a powerful and highly ...

  8. Android Bluetooth蓝牙开发:发现Bluetooth蓝牙设备(1)

     Android Bluetooth蓝牙开发:发现Bluetooth蓝牙设备(1) Android Bluetooth蓝牙作为设备,要与其他蓝牙设备互联,那么先决条件就是已经被发现,本文先简介An ...

  9. Spring Security中文文档

    Spring Security中文文档 来源:https://www.springcloud.cc/spring-security.html#overall-architecture 作者 Ben A ...

最新文章

  1. C#生成Excel文件的方法
  2. 永远不要对 AI 说:“我不行!”
  3. J. Cheminform. | GraphSol:预测接触图助力蛋白质溶解度预测
  4. 谷歌新发布的分布式数据库服务,是要打破CAP定理了吗?
  5. 关闭Struts2中s:property的HTML自动转码
  6. HTML基础标签入门
  7. Azure负载均衡器Standard Load Balancer介绍
  8. xml gridview控件增删改查_Mybatis之XML如何映射到方法
  9. 网狐框架分析八--web登录游戏大厅流程
  10. [Swagger2]SpringBoot集成Swagger
  11. JS document.execCommand实现复制功能
  12. 英特尔核芯显卡控制面板没有了_核显和独显、集成显卡有什么区别
  13. Codeforces Round #368 (Div. 2) C. Pythagorean Triples
  14. GPU Raycasting的两种实现方法
  15. 计算机考证广东省ps
  16. 大学计算机协会大一面试,大一学生社团面试自我介绍
  17. dns服务器配置错误无法修复,电脑DNS错误修复的方法教程
  18. 专访阿里云游戏首席架构师李刚:如何解决云服务技术两大痛点?
  19. 207399-07-3,IR-780;IR-808;1558079-49-4,IR-825
  20. 用SmartDraw绘制需求分析过程中的功能图

热门文章

  1. Linux——shell练习题01
  2. 虚拟机提示“虚拟设备在启动时将处于断开连接状态”
  3. 大运动量的体能训练之后,如何迅速恢复体力?
  4. 如何使用Gitte获取和上传代码
  5. 磁场发生装置WD-50电磁铁
  6. SV笔记:static 和 automatic 概念及相关规定
  7. linux下密码生成软件 APG
  8. 大数据发展何去何从?该掌握哪些?
  9. 如何升级手机android系统,安卓手机系统怎么升级,安卓手机系统升级教程
  10. 人工智能领域的会议和期刊(转载)