EMZETT.
Login

Hardware security modules (HSM): Keys in tamper-resistant hardware

In short: An HSM is a secured device that generates and stores cryptographic keys and performs calculations with them without the key ever being readable.

In more detail: Encryption is only as secure as the key. If a private key lies as a file on a server, an attacker with access can steal it. A hardware security module (HSM) keeps keys in a specially protected environment: applications send data in and get the result (signature, decryption) back; the key never leaves the module.

In Depth

Structure and protection

An HSM is a PCIe card or network appliance with its own processor, random number generator and protected memory. It is tamper-resistant: on opening or sensor alarm it deletes the keys. It is certified under FIPS 140-2/140-3 or the Common Criteria. Access requires authentication, often by several people (four-eyes principle, “m of n”).

Uses

  • Certification authorities (CAs) keep their root and intermediate keys there.
  • Payment transactions: PIN verification, card keys.
  • Code signing: signing keys for software.
  • Database and disk encryption (master keys).
  • Digital signatures and qualified seals (eIDAS).
  • TLS keys of large web services (offloading).

Cloud and small forms

Cloud providers offer key management services (AWS KMS, Azure Key Vault, Google Cloud KMS) with HSM protection in the background, partly as an exclusive cloud HSM. Smaller variants are smart cards, YubiKeys and the TPM in the computer, which also hold keys and only perform operations. The principle: keys are not copied but “used”.

Limits

An HSM protects the key but not against a compromised system using the HSM abusively for signing as long as it is connected. So access logs and limits belong with it. HSMs are expensive and require operation and backup concepts (key material is exported encrypted for backups). For small projects secret managers or hardware tokens are often enough.

See also: Certification authorities, Digital signature, eIDAS