A Hardware Security Module is a dedicated device (or chip region) for tamper-resistant cryptographic operations and key storage. Keys generated inside an HSM never leave it in plaintext — all operations happen inside the secure boundary.

Why software key storage fails: A key in RAM can be extracted via memory dump, cold-boot attack, or a software vulnerability. A key in an HSM can only be used by issuing a command to the HSM — the attacker needs physical access and must defeat tamper detection to extract it.

Q-Safe's software HSM approach: A dedicated RP2040 microcontroller acts as the HSM. Physical separation from the gateway host. The RP2040 has a hardware RNG (ROSC ring oscillator) for key generation, and its second core is dedicated to cryptographic operations. Keys are stored in RP2040 flash with XIP (execute-in-place) access.

This is not a production HSM — it lacks tamper-evident packaging, side-channel countermeasures, and formal certification. But the architecture is correct: keys are generated and used inside the boundary, and the interface is a simple command protocol.

Production HSMs (what this maps to):

  • Trusted Platform Module (TPM 2.0): standardised, in every PC
  • ARM TrustZone: on-chip secure world for Cortex-A/M35P
  • Secure Enclave: Apple's variant
  • PKCS#11: standard API for HSM interaction from application code