An HSM is a dedicated computer in a tamper-resistant enclosure that does nothing but cryptography. Keys are born inside, signing and decryption operations run inside, and only the result leaves the device — a signature or a decrypted block of data, for example. Such a module is needed wherever a compromised key would cost too much: in banks, at certificate authorities, in the root key management services of cloud providers.
Keys never leave the device
An ordinary encryption key sits in a file or in server memory, and anything with access to the server can read it. In an HSM the key is generated inside a protected chip and cannot be exported: it either never leaves the device at all or leaves only in encrypted form under another key. The application sends the module data, the module performs the operation and returns the result.
- key generation on a built-in random number generator
- signing of data and certificates with a private key that is never exported
- decryption and encryption on request from an application
- issuing of random numbers and storage of counters for tokens
- key wrapping: a key is exported only in encrypted form
The enclosure and the circuitry are built to resist tampering: if anyone tries to open the module, strip its defences or probe it under abnormal conditions, the memory holding the keys is zeroed. So an attacker who gains physical access is more likely to come away with no key at all than to crack the module.
FIPS 140-3 certification
The main measure of trust in a cryptographic module is the FIPS 140-3 standard (NIST): it defines four security levels, from validated algorithms to resistance against physical attacks. A module is tested at a laboratory of the CMVP programme and enters the public list of validated cryptographic modules. Customers — banks, government bodies — often require a specific level right in the contract.
| Level | What it adds |
|---|---|
| 1 | the algorithms and implementation meet FIPS requirements; basic protection |
| 2 | tamper evidence: seals and coatings that cannot be removed unnoticed; separation of roles |
| 3 | tamper response: keys are zeroed when the lid is removed; identity-based authentication |
| 4 | on top of that, environmental protection: response to temperature or voltage going out of range |
Where HSMs are used
| Task | Role of the HSM |
|---|---|
| Payments | PIN verification, card issuing and payment card keys; requirements of card networks and PCI DSS |
| Certificate authority | the root key is kept in the HSM and certificates are signed in it |
| Cloud root keys | the KMS services of cloud providers keep their root keys in HSMs |
| Code and document signing | the signing key cannot be copied, every signature is logged |
Modules come in different form factors: a network appliance or a PCIe card for a data centre, a USB token for an individual developer or a certificate authority, cloud HSM as a managed service. The choice depends on the workload and on who should physically own the keys.
Sources
the term is written from these pagesVerified 9 Nov