Skip to content

Repository files navigation

HardaBLE

Requirements

  1. West version: v0.14.0 + (actually using v1.5.0)
  2. zephyr-sdk-0.17.0 (west sdk install --version 0.17.0)
  3. nrfjprog (https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools/Download)
  4. nrfutil (https://www.nordicsemi.com/Products/Development-tools/nRF-Util) --> may be redundant with 3) but somehow 4) alone dont work even with nrfutil device and nrf5sdk-tools

Setup

  1. mkdir workspace && cd workspace
  2. python -m venv .venv && source .venv/bin/activate
  3. pip install west
  4. git clone https://github.com/norrathep/blesec.git (and switch to this branch)
  5. (from workspace folder) west init -l blesec && west update
  6. cd blesec && ./patch.sh && ./build_and_flash.sh pristine

VARIA

This implementation protects the BLE LTK against local device compromise.

Standard BLE Session Establishment

        Host C     Controller C      Controller P       Host P
        |            |                  |                |
        |            |                  |                |
        |----LTK---->|                  |                |
        |            |                  |                |
        |            |----SKD_C,IV_C--->|                |
        |            |                  |                |
        |            |<---SKD_P,IV_P----|                |
        |            |                  |                |
        |            |                  |--Request LTK-->|
        |            |                  |                |
        |            |                  |<-----LTK-------|
        |            |                  |                |
        |        +-------------------------+             |
        |        |SK=AES(LTK, SKD_C||SKD_P)|             |
        |        +-------------------------+             |
        |            |                  |                |
        |            |<--START_ENC_REQ--|                |
        |            |                  |                |
        |            |--START_ENC_RSP-->|                |
        |            |                  |                |
        |            |--START_ENC_RSP-->|                |
        |            |                  |                |
        |=============ENCRYPTED SESSION==================|

Our version (Host with TEE, Controller without)

        C_host        C_ctrl           P_ctrl          P_host
        |             |                |                |
        |             |                |                |
        |--SKD_C,IV_C>|                |                |
        |             |==SKD_C,IV_C===>|                |
        |             |                |--SKD_C,IV_C--->|
        |             |                |<-SKD_P,IV_P----|
        |             |<==SKD_P,IV_P===|                |
        |<--SKD_P,IV_P|                |                |
        |             |                |                |
  +------------+      |                |          +------------+
  | SK=AES(...)|      |                |          | SK=AES(...)|
  +------------+      |                |          +------------+
        |             |                |                |
        |-----SK----->|                |                |
        |             |                |<-----SK--------|
        |             |                |                |
        |             |-START_ENC_REQ->|                |
        |             |                |                |
        |             |<-START_ENC_RSP-|                |
        |             |                |                |
        |             |-START_ENC_RSP->|                |
        |             |                |                |
        |=============ENCRYPTED SESSION=================|

If the Controller has a separate TEE, SK can be encrypted in traffic using a prior-established symmetric key.

There are two approaches:

[1] To test original BLE (without TEE-based pairing) comment out CONFIG_BT_SECURE_LTK=y and CONFIG_BT_USE_PSA_API=y in peripheral_sc_only/prj.conf and hci_ipc/prj.conf. Then build and flash using the script.

[2] To test pairing with BLE partition in TF-M, with single Host TEE (SK sent in plaintext) uncomment CONFIG_BT_SECURE_LTK=y and CONFIG_BT_USE_PSA_API=y from those files.

Evaluation

The evaluation folder contains all the evaluation data that were used in the paper.

The following command plots the current trace of BLE session establishment vs HardaBLE:

python evaluation/current_trace_plot.py

The following two commands compute the session establishment performance data:

python no-att-power.py evaluation/ble-tee-ppk-measurements/ppk-50-ble-session.csv evaluation/ble-tee-time-measurements/standard_session_est.log

python no-att-power.py evaluation/ble-tee-ppk-measurements/ppk-50-hardble-single.csv evaluation/ble-tee-time-measurements/hardble_single_no_att.log

python att-power.py evaluation/ble-tee-ppk-measurements/ppk-50-hardble-single-att.csv evaluation/ble-tee-time-measurements/hardble_single_att.log

The following two commands compute the pairing performance data: python no-att-power.py evaluation/ble-tee-ppk-measurements/ppk-50-ble-pairing.csv evaluation/ble-tee-time-measurements/standard_pairing.log

python no-att-power.py evaluation/ble-tee-ppk-measurements/ppk-50-hardble-pairing.csv evaluation/ble-tee-time-measurements/hardble_pairing.log

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages