This project consists of several folders:
- Baseline: For measuring performance of the baseline approach
- Measurement: For measuring performance of SLAPP
- LDP: For running a case study based on LDP using
SLAPP_{SK} - LDP-Baseline: For running a case study based on LDP using
Baseline_{SK} - FL: For running a case study based on Federated Learning using
SLAPP_{SK} - FL-Baseline: For running a case study based on Federated Learning using
Baseline_{SK} - Overhead: Computing the runtime overhead w.r.t. existing work
- Plot: For plotting all graphs in the paper
NUCLEO-L552ZE-Q ↔ Verifier (where ↔ denotes serial communication)
PZEM-004T ↔ CucumberR ↔ NUCLEO-L552ZE-Q ↔ Verifier (where ↔ denotes serial communication)
- Download STM32CubeIDE. See this repo for setting up
NUCLEO-L552ZE-Q: ISC-FLAT_open_source - In STM32CubeIDE:
- File → Import → Existing Projects into Workspace → Select the folder of interest
- Click TRACES_NonSecure (in
NonSecure) folder → Click Run (green play symbol) → Select Startup → Add Secure counterpart
- Each folder should include a Verifier folder with
main.py. Runmain.py. (You may need to re-plug the USB cable forNUCLEO-L552ZE-Qafter building/uploading firmware before runningmain.py.)
- For LDP case study:
- Connect CucumberR (ESP32-S2) to PZEM-004T.
(RX, TX) = (16, 17)on CucumberR.- CucumberR acts as an interface for
NUCLEO-L552ZE-Qto read data from PZEM-004T. - CucumberR firmware:
- Download "esp32" library (from the left toolbar in Arduino IDE) and possibly Arduino AVR Boards.
- Open
pzem.inofromLDP -> PZEM-interfaceand build/upload the firmware. - Connect CucumberR to NUCLEO-L552ZE-Q:
- CucumberR IO2 → PA2
- CucumberR IO3 → PA3 (See
ldp-setup.jpg)
- A1: Poisoning the initial state during
Setupphase.- Uncomment
#define ATTACK_A1inLDP/TRACES_NonSecure/Core/Src/main.c - Rebuild and reupload the binary, then execute as normal.
ldp.pyshould throw an error inSetupphase.
- Uncomment
- A2: Poisoning attack after
Setupphase to manipulate raw energy data.- Execute
Setupwith benign binary. - Uncomment
#define ATTACK_A2, rebuild, and reupload. - Execute
Collectphase (ccommand inldp.py). ldp.pyshould throw an error inCollectphase.
- Execute
- A3: Poisoning attack after
Setupphase to manipulate state variable (Map B).- Same steps as A2, but uncomment
#define ATTACK_A3. - It should raise an exception.
- Same steps as A2, but uncomment
- A4: Attack during
Collectphase to modify noisy energy data.- Run benign code in SAML11, but set
ATTACK_A4 = Trueinldp.py. - It should raise an exception.
- Run benign code in SAML11, but set
Note:
- When updating the benign Non-Secure World's code, replace
Verifier/TRACES_NonSecure.elfwith the newly built binary (NonSecure/Debug/). - For PMEM size experiments, update
mem_leninsecure_nsc.c(TRACES_Secure/Core/Src) to0x40000andmemto0x80401f8.
- AD: Poisoning training data before
Local Training.- After
SetupandCollectionphases, killfl.py. - Uncomment
#define ATTACK_ADinTRACES_NonSecure/Core/Src/main.c. - Rebuild and reupload the binary, then execute as normal.
fl.pyshould throw an error inSetupphase.
- After
- AM: Attack in
Local Trainingphase to manipulate model parameters.- Run benign code in NUCLEO but set
ATTACK_AM = Trueinfl.py. - Execute as normal;
fl.pyshould raise an exception.
- Run benign code in NUCLEO but set
- NUCLEO-L552ZE-Q serial driver is buggy—energy value reads only once before stopping.
- Serial driver implementation in Non-Secure World is not functional; currently resides in Secure World. However, its small code size should not significantly impact experimental results.
- FL case study is based on dummy data. Incorporating PZEM-004T (+CucumberR) remains incomplete but should not affect experimental validity.
- Peak runtime memory usage:
- Computed from stack usage +
.rodata,.data, and.bsssections. - Stack usage estimated using Static Stack Analyzer in STM32CubeIDE.
- For FL, heap allocation tracked via
heapSizeinNonSecure/Core/Src/main.c.
- Computed from stack usage +
- FLASH size: Determined from
TRACES_Secure/Debug/TRACE_Secure.list (.text). - Runtime breakdown by phases: Based on printed messages (
PhaseX start).