查看: 746|回复: 0

[技术交流] mesh 分层架构-key

[复制链接]

8

主题

12

帖子

33

积分

助理工程师

Rank: 1

积分
33
发表于 2020-5-27 09:54:26 | 显示全部楼层 |阅读模式
本帖最后由 BLE001 于 2020-5-27 10:03 编辑

Key:
关于 Key 的概念这里就先不细说,这里主要讨论的是 如何生成Key 和 Key如何生成一些参数

Device key:
device key(DevKey)是仅 node and  Configuration Client 知道的 access layer key。 device key 应绑定到节点已知的每个 network key。 这些绑定不能更改。 device key 派生的示意图如图3.36所示。
DevKey 从 ECDHSecret and ProvisioningSalt 派生,公式如下所示:

其中 ECDHSecret 的生成方式如下:
  • private key 和 peer public key 为 自己的私钥 和 ECDH交换的公钥,最终得到密钥

其中 ProvisioningSalt 的生成方式如下:



  • ProvisioningInvitePDUValue 是 Provisioning Invite PDU fields 的值(不包括 opcode)
  • ProvisioningCapabilitiesPDUValue 是 Provisioning Capabilities PDU fields 的值 (不包含opcode)
  • ProvisioningStartPDUValue 是 Provisioning Start PDU fields 的值(不包含opcode)
  • PublicKeyProvisioner is the value of the Public Key X and Public Key Y fields from the Public Key  PDU that was sent by the Provisioner.
  • PublicKeyDevice is the value of the Public Key X and Public Key Y fields from the Public Key PDU  that was sent by the Device or from the delivered OOB public key.

Application key:
应用密钥(AppKey)没有特定的生成规则,由 provisioner 自己设置。
application key identifier (AID)用于标识 application key。 图3.37给出了AID推导的示意图。
AID:



Network key:
网络密钥(NetKey)没有特定的生成规则,由 provisioner 自己设置。 图3.38显示了网络密钥层次结构。

NID, Encryption Key, and Privacy Key:
master security materials(主安全性材料)是从master security credentials(主安全性凭证)使用以下方法派生的:

friendship security materia(友谊安全性材料)是从 friendship security credentials (友谊安全性凭证)使用以下内容派生的:

  • LPNAddress 是在建立 friendship 的 Friend  Request message 中设置为源地址的单播地址。
  • FriendAddress 是在建立 friendship 的 Friend Offer message 中设置为源地址的单播地址。
  • LPNCounter 是在建立 friendship 的 Friend  Request message 中 LPNCounter field 的值。
  • FriendCounter 是在建立 friendship 的 Friend Offer message 中 FriendCounter field 的值。

对于在具有 friendship 的 LPN 和 Friend node 之间发送的 Network PDUs ,将使用 friendship security material 。
对于所有其他Network PDUs,使用master security materials。

Network ID:
从 Network key 派生 Network ID,以便每个 Network key 生成一个Network ID。 该标识符成为公共信息。

IdentityKey:
IdentityKey 是从 Network key 派生的,因此每个 Network key 都会生成一个 IdentityKey。

BeaconKey:
BeaconKey 是从 network key 派生的,因此每个 network key 都会生成一个Beaconkey。

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表