- West version: v0.14.0 + (actually using v1.5.0)
- zephyr-sdk-0.17.0 (west sdk install --version 0.17.0)
- nrfjprog (https://www.nordicsemi.com/Products/Development-tools/nRF-Command-Line-Tools/Download)
- 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
mkdir workspace && cd workspacepython -m venv .venv && source .venv/bin/activatepip install westgit clone https://github.com/norrathep/blesec.git(and switch to this branch)- (from workspace folder)
west init -l blesec && west update cd blesec && ./patch.sh && ./build_and_flash.sh pristine
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.
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