Bookmarks

HSM — hardware security module

A device that generates cryptographic keys, stores them and performs operations on them in a way that the keys never leave the secure enclosure.

Also: cryptographic module, crypto module

checked 9 Nov

All terms

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.

LevelWhat it adds
1the algorithms and implementation meet FIPS requirements; basic protection
2tamper evidence: seals and coatings that cannot be removed unnoticed; separation of roles
3tamper response: keys are zeroed when the lid is removed; identity-based authentication
4on top of that, environmental protection: response to temperature or voltage going out of range

Where HSMs are used

TaskRole of the HSM
PaymentsPIN verification, card issuing and payment card keys; requirements of card networks and PCI DSS
Certificate authoritythe root key is kept in the HSM and certificates are signed in it
Cloud root keysthe KMS services of cloud providers keep their root keys in HSMs
Code and document signingthe 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 pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • KMSkey management service

    A KMS is a key management service with an API and access policies; an HSM is a device where such services often keep their root keys.

In depth in the references

where the topic is covered in detail