HSM
A tamper-resistant device that generates, stores and uses keys internally so the key material cannot be extracted.
An HSM is dedicated hardware that keeps keys inside a tamper-resistant boundary and performs signing, decryption and key wrapping there. Validation is against FIPS 140-3 (the successor to FIPS 140-2), usually at Level 3 for anything holding root keys. Applications talk to it via PKCS#11, JCE, KMIP or a vendor API.
They anchor the top of key hierarchies: CA root keys, KMS master keys, payment PIN keys, card tokenisation keys. Cloud KMS products are built on fleets of HSMs; dedicated options (AWS CloudHSM, Azure Managed HSM) exist when you need single-tenant control.
An HSM stops key theft, not key misuse: an attacker with API access can still ask it to sign or decrypt. So access control, quorum (M of N) for administrative actions, and logging around the HSM matter as much as the hardware. Do not confuse it with a TPM, which is a cheap per-device chip for platform identity and measurement.
Learn it properly
Compared
Also used in
- Cryptography you actually needSecEng · Foundations of Security EngineeringFree
- TLS and PKI in practiceSecEng · Network & Infrastructure SecurityFree
- Post-quantum migrationSecEng · Applied cryptography engineeringFree
- Design an SSO identity providerHLD · Design problems: Access & identityFree
- Design a tamper-evident audit logHLD · First security designsFree
- Design a password hashing module with upgradesLLD · Problems: crypto & protocol componentsFree
- Constant-time comparison and secrets in memoryLLD · Secure coding building blocksFree
- SSO at scale: SAML, OIDC and SCIMSecEng · Identity & Access EngineeringPro