Home/ ECE/ Hardware Security Modules (HSM) for TinyML
ECE · Seminar 08 · Protecting models on microcontrollers

Hardware Security Modules (HSM) for TinyML

Lightweight hardware roots of trust secure TinyML devices by protecting model weights, keys and firmware against extraction and tampering on resource-constrained edge hardware.

HSMTinyMLroot of trustsecure enclaveside-channel

TinyML runs machine-learning inference on microcontrollers with kilobytes of memory. These devices are deployed in the field where attackers have physical access — they can probe buses, dump flash and run side-channel attacks. A Hardware Security Module (HSM) — or its embedded cousin, a secure element / trusted-execution root of trust — protects the device's secrets and the ML model itself, which is valuable intellectual property.

Working principle

A hardware root of trust stores keys in tamper-resistant memory and performs cryptographic operations inside the secure boundary, so private keys never appear in general memory. At boot it performs secure / measured boot, verifying firmware signatures before execution. Model weights can be stored encrypted and decrypted only inside the protected region, defeating cloning. Countermeasures (masking, constant-time code) blunt power and electromagnetic side-channel attacks.

crypto reqnever leavesmeasureattestMCU + TinyML inferenceSecure element / root of trustKeys (sealed)Encrypted model + firmwareSecure boot verify signaturesHardware root of trust guarding a TinyML device
Figure 1. Secrets stay inside the secure boundary; firmware is verified at boot and the model is decrypted only within the protected region.
Table 1. Threats and HSM countermeasures
ThreatCountermeasure
Key extractionKeys sealed in tamper-resistant HW
Firmware tamperingSecure / measured boot + signing
Model cloning (IP theft)Encrypted weights, on-device decrypt
Power / EM side-channelMasking, constant-time operations
ConstraintSecurity must fit a milliwatt, kilobyte budget: full HSMs are too large, so embedded secure elements and ISA security extensions (e.g. Arm TrustZone-M, RISC-V PMP) provide a proportionate root of trust.

Applications

  • Securing keyword-spotting and predictive-maintenance sensors
  • Protecting proprietary edge ML models from theft
  • Authenticated, attestable IoT fleets

References & further reading

  1. Banbury et al., “Benchmarking TinyML Systems (MLPerf Tiny),” 2021.
  2. Kocher et al., “Differential Power Analysis,” CRYPTO 1999.
  3. GlobalPlatform / TCG specifications for embedded roots of trust, 2023.