6.3 Amazon Sidewalk BLE security
The Amazon Sidewalk security model, architecture and certificate chain are described in Chapter 4, section 4.1, section 4.1.1, section 4.1.2. The frame structure is described in section 4.8. The key structure and names, key exchange and authentication procedure are the same as those described for sub-GHz technology in section 4.5. The following sections of the document focus on the differences in implementation for the specificity of the BLE medium (high bandwidth and available frame length 255 B). The procedures for synchronization, registration and authentication of an Endpoint in the Amazon Sidewalk system are described in Chapter 4, and in section 4.2 and section 4.4.2.2.
6.3.1 Amazon Sidewalk Application Layer credentials
Detailed specification for the Amazon Sidewalk Application Layer credentials for Network Server and Application Server are presented in the following subsections.
6.3.1.1 Network Server Encryption/Decryption
Counter-based credentials are used only after a factory reset when an Endpoint has not yet synchronized time. Time-based credentials are used for regular data traffic.
Symmetric keys with 128 bit length are used for coding the Network Server link. Authentication tag is 4 B size. Initialization vector is 12 B length. Additional Authentication Data are a concatenation of Flex parameters listed in Table 6.2 below.
Table 6.2 Encryption and Decryption parameters
| Credentials | Time-based Commands | Counter-based Commands | Registration (Touchless FFN / Mobile) |
|---|---|---|---|
| Key type | GCM_KEY | GCM_CTRREF_KEY | GCM_CTRREF_KEY |
| Authentication tag | 4B | 4B | 4B |
| AAD | 1B Flex Header lengthFLEX_KEY_LL_SEQ_NUMFLEX_KEY_SRC_FRMT | FLEX_KEY_SRCFLEX_KEY_DST_FRMT | FLEX_KEY_DSTFLEX_KEY_ENCR_ENAFLEX_KEY_PROTOCOL_VERFLEX_KEY_SEC_REF_COUNTER_VALFLEX_KEY_SEC_TOPOLOGYFLEX_KEY_SEC_REFFLEX_KEY_IS_DATA_ASL_FORMATTED | 1B Flex Header lengthFLEX_KEY_LL_SEQ_NUMFLEX_KEY_SRC_FRMT | FLEX_KEY_SRCFLEX_KEY_DST_FRMT | FLEX_KEY_DSTFLEX_KEY_ENCR_ENAFLEX_KEY_PROTOCOL_VERFLEX_KEY_SEC_REF_COUNTER_VALFLEX_KEY_SEC_TOPOLOGYFLEX_KEY_SEC_REFFLEX_KEY_IS_DATA_ASL_FORMATTED | 1B Flex Header lengthFLEX_KEY_LL_SEQ_NUMFLEX_KEY_SRC_FRMT | FLEX_KEY_SRCFLEX_KEY_DST_FRMT | FLEX_KEY_DSTFLEX_KEY_ENCR_ENAFLEX_KEY_PROTOCOL_VERFLEX_KEY_SEC_REF_COUNTER_VALFLEX_KEY_SEC_TOPOLOGYFLEX_KEY_SEC_REFFLEX_KEY_IS_DATA_ASL_FORMATTED |
| IV | 5B Source ID | 2b Link type 22b Sequence number | 4B Reference time | 5B Source ID | 2b Link type 22b Sequence number | 4B counter reference | 5B Source ID | 2b Link type 22b Sequence number | 4B counter reference |
Link type: 0x0 = Radio, 0x1 = BLE
6.3.1.2 Counter-based network server security
Counter-based network security is used in the registration procedure and the deregistration procedure when an Endpoint has not yet synchronized time. Payload is processed according to the formula:
AES-GCM (Encrypted Payload, AAD, IV, Authentication TAG, GCM_CTRREF_KEY)
where
GCM_CTRREF_KEY = CMAC(NETWORK_PRIMARY_KEY, "Network KDF Dev Ntw GCM COUNTER" | Counter Reference)
and Counter Reference = Counter value supplied in the flex header.
6.3.1.3 Network Server Authentication parameters (Only TIME_SYNC command)
Counter-based time synchronization (TIME_SYNC command) is used when an Endpoint reboots and/or over the periodic time sync.
The only difference between the time-based and counter-based time sync commands is the key type used. Details are presented in Table 6.3.
Table 6.3 BLE key types
| Credentials | Time-based | Counter-based |
|---|---|---|
| Key type | TSYNC_RESP_KEY (Not Supported) | TSYNC_RESP_CTRREF_KEY |
| Authentication Tag (MAC) size | 4B | 4B |
| IV (Initialization Vector) | None | None |
| AAD (Additional Authentication Data) | 1B Flex Header lengthFLEX_KEY_LL_SEQ_NUM | FLEX_KEY_SRC_FRMTFLEX_KEY_SRC | FLEX_KEY_DST_FRMTFLEX_KEY_DST | FLEX_KEY_ENCR_ENAFLEX_KEY_PROTOCOL_VERFLEX_KEY_SEC_REF_COUNTER_VALFLEX_KEY_SEC_TOPOLOGY | FLEX_KEY_SEC_REFFLEX_KEY_IS_DATA_ASL_FORMATTED | 1B Flex Header lengthFLEX_KEY_LL_SEQ_NUM | FLEX_KEY_SRC_FRMTFLEX_KEY_SRC | FLEX_KEY_DST_FRMTFLEX_KEY_DST | FLEX_KEY_ENCR_ENAFLEX_KEY_PROTOCOL_VERFLEX_KEY_SEC_REF_COUNTER_VALFLEX_KEY_SEC_TOPOLOGY | FLEX_KEY_SEC_REFFLEX_KEY_IS_DATA_ASL_FORMATTED |
6.3.2 Application Server Encryption/Decryption
AES-CTR cryptography is used for Application Server data processing. Details are presented in Table 6.4.
Table 6.4 Encryption/Decryption parameters
| Credentials | Time based | Registration |
|---|---|---|
| Key type | APP_CTR_KEY | APP_GCM_CTRREF_KEY |
| AAD (Additional Authentication Data) | NONE | 1B Flex Header length | FLEX_KEY_LL_SEQ_NUMFLEX_KEY_SRC_FRMT | FLEX_KEY_SRC | FLEX_KEY_DST_FRMTFLEX_KEY_DST | FLEX_KEY_ENCR_ENAFLEX_KEY_PROTOCOL_VER | FLEX_KEY_SEC_REF_COUNTER_VALFLEX_KEY_SEC_TOPOLOGY | FLEX_KEY_SEC_REFFLEX_KEY_IS_DATA_ASL_FORMATTED | 2B - 4B of plain text ASL header |
| Authentication Tag (MAC) size | NONE | 4B |
| IV (Initialization Vector) | 5B Source ID | 1b uplink/downlink | 7b Zeros 2B app layer seqn | 4B time reference | 4B Zeros Source ID: Component generating the packet UL: Sidewalk ID DL: Cloud component generating the packet 1b uplink/downlink: 1 = uplink, 0 = downlink 4B Zeros: Padding to align 16Bytes IV | 5B Source ID | 1b Link type | 7b null 2B app layer seqn | 4B counter reference Source ID: Component generating the packet UL: Sidewalk ID DL: Cloud component generating the packet (Provisioning Service) link type: 1 = uplink, 0 = downlink |
6.3.3 D2D-related parameters
D2D feature uses a security procedure similar to that used for registration. D2D_PRIMARY_KEY is used for mobile to Endpoint communication. Derived keys with their credentials and derivation method are in Table 6.5.
Table 6.5 Device to device keys
| Credentials | D2D_GCM_KEY | D2D_GCM_CTRREF_KEY |
|---|---|---|
| Key type | time based | counter based |
| Authentication tag | 4B | 4B |
| AAD | 1B Flex Header length | FLEX_KEY_LL_SEQ_NUMFLEX_KEY_SRC_FRMT | FLEX_KEY_SRCFLEX_KEY_DST_FRMT | FLEX_KEY_DSTFLEX_KEY_ENCR_ENA | FLEX_KEY_PROTOCOL_VERFLEX_KEY_SEC_REF_COUNTER_VALFLEX_KEY_SEC_TOPOLOGY | FLEX_KEY_SEC_REFFLEX_KEY_IS_DATA_ASL_FORMATTED | 1B Flex Header length | FLEX_KEY_LL_SEQ_NUMFLEX_KEY_SRC_FRMT | FLEX_KEY_SRCFLEX_KEY_DST_FRMT | FLEX_KEY_DSTFLEX_KEY_ENCR_ENA | FLEX_KEY_PROTOCOL_VERFLEX_KEY_SEC_REF_COUNTER_VALFLEX_KEY_SEC_TOPOLOGY | FLEX_KEY_SEC_REFFLEX_KEY_IS_DATA_ASL_FORMATTED |
| IV | 5B Source ID | 2b Link type 22b Sequence number | 4B counter reference | 5B Source ID | 2b Link type 22b Sequence number | 4B counter reference |
| Key derivation | CMAC(D2D_PRIMARY_KEY, "Mobile KDF Device Mobile GCM" | time reference for this key) | CMAC(D2D_PRIMARY_KEY, "Mobile KDF Device Mobile GCM COUNTER" | [0x00, 0x00, 0x00, 0x00]) |