TPM (Trusted Platform Module) and HSM (Hardware Security Module) are considered as cryptoprocessor, but what are the differences exactly?

Does one of them has more advantages than another?

  • 2
    They are similar, and TPMs can actually be used as rudimentary HSMs and keep private keys secure, though conventional HSMs are focused on performance and key storage space, where as TPMs are only designed to keep a few values (PCRs) and a single key in memory and don't put much effort into performance (cf. the 1 request/second on the SSL example).
    – user42178
    Commented May 7, 2015 at 20:51

6 Answers 6


Trusted Platform Modules

A Trusted Platform Module (TPM) is a hardware chip on the computer’s motherboard that stores cryptographic keys used for encryption. Many laptop computers include a TPM, but if the system doesn’t include it, it is not feasible to add one. Once enabled, the Trusted Platform Module provides full disk encryption capabilities. It becomes the "root of trust" for the system to provide integrity and authentication to the boot process. It keeps hard drives locked/sealed until the system completes a system verification, or authentication check.

The TPM includes a unique RSA key burned into it, which is used for asymmetric encryption. Additionally, it can generate, store, and protect other keys used in the encryption and decryption process.

Hardware Security Modules

A hardware security module (HSM) is a security device you can add to a system to manage, generate, and securely store cryptographic keys.

High performance HSMs are external devices connected to a network using TCP/IP. Smaller HSMs come as expansion cards you install within a server, or as devices you plug into computer ports.

One of the noteworthy differences between the two is that HSMs are removable or external devices. In comparison, a TPM is a chip embedded into the motherboard. You can easily add an HSM to a system or a network, but if a system didn’t ship with a TPM, it’s not feasible to add one later. Both provide secure encryption capabilities by storing and using RSA keys.

Source: https://blogs.getcertifiedgetahead.com/tpm-hsm-hardware-encryption-devices/

  • 11
    You beat me to the post. Some things I would add are that HSMs perform sign / decrypt operations on the device so that the private keys never enter the RAM of the host OS. Also worth noting is that HSMs are often embedded on corporate ID badges so that when someone walks away from their desk, their computer is no longer capable of decrypting / signing, even if an attacker knows all their passwords. Commented May 7, 2015 at 20:21
  • Very good start on PCM, do extend on sealing and PCRs though :-) An excellent application of TPMs is trusted code execution, see cs.unc.edu/~reiter/papers/2008/EuroSys.pdf Commented May 7, 2015 at 20:43
  • s/if a system didn’t ship with a TPM/if a system wasn't designed for a TPM/ I'm quite sure I've seen motherboards which had a special socket designed to accept a TPM. And in fact you can find plenty of evidence of this
    – Ben Voigt
    Commented May 7, 2015 at 22:26
  • 3
    It is not true that you cannot add a TPM chip to a motherboard later; at least not for workstation/server motherboards, you can easily add the TPM later.
    – larsw
    Commented Nov 7, 2015 at 18:02
  • 3
    This answer apepars to be plagiarised completely from this author: blogs.getcertifiedgetahead.com/… The book was published in 2014. amazon.com/gp/product/1939136024/ref=dbs_a_def_rwt_bibl_vppi_i3 Text can be found: archive.org/stream/…
    – schroeder
    Commented Aug 28, 2018 at 19:14

Sorry, but I think there are some gaps in this conversation:

  1. TPMs can't be added later : False. Many modern motherboards include a header to which a TPM can be added after the fact. Visit Amazon and look at the TPM modules cards for MSI, Asus, and other motherboards
  2. HSMs are typically removed or network attached : False. HSMs can be embedded in a range of hardware from FIPS 140-3 compliant rack mount chassis, to PCI-E cards, to USB keys, to MicroSD cards

The primary difference is in use. TPMs are meant to provide a hardware root of trust to enable secure computing by providing a secure key storage enclave with minimal cryptographic functions primarily in the signing and signature verification space. Some one did outline the primary use cases ... storage of drive encryption keys and validation of signatures on boot loaders, kernels, and device drivers. Note, much of this can be accomplished without a TPM (secure boot with bios that support Windows WHQL including default Microsoft keys), password based disk encryption. TPMs typically cost between $7 USD (as part of the bill of materials for a custom board) to $15 USD (as a pluggable module for after market modification). TPMs can include smart card reader / virtual smart card functionality.

HSMs typically have two primary, closely related functions. The first function is hardware enabled / accelerated cryptographic functions including encipherment, decipherment, key generation, PRNG functions, and related signing/signature validation functions. Typically these are hardware accelerated by onboard FPGA or ASIC (or a combination). The second function typically is a smart card reader with / without virtual smart card for key / certification storage with enhanced (PIN) based protections. The integration of the two provides a powerful model for using hardware to generate a non-exportable certificate embedded within the virtual smart card. HSMs can run from tens of thousands of dollars (for chassis based solutions) to thousands of dollars (for PCIE cards) to 100s of dollars (USB) to 10s of dollars (for H-SDC versions).

In my experience, TPMs are primarily used for key storage, HSMs are primarily used for hardware accelerated cryptography with key storage.

  • how does secure boot without a TPM even work though? Does that mean just secure boot from ROM? Commented Mar 29, 2020 at 18:07
  • 1
    @David天宇Wong Secure boot checks signatures, which requires only the public key. Being able to read the public key is not a big deal, because it is public. You store the private key you use for signing somewhere else. As of TPM those store the private key, but they never expose it. They can sign stuff with it and I guess give out public keys, but I read only a few articles in the topic. So I think you don't need TPM for secure boot, but I need it because I want to give drive encryption password via SSH and I want to hide SSH private keys. Note that I have very limited understanding of the topic
    – inf3rno
    Commented Apr 4, 2020 at 3:30

TPMs are very exactly specified parts wrt to function and security level they provide (https://www.trustedcomputinggroup.org).

It has fixed function, is a rather low cost and yet high security chip (less than $2.00). The purpose is to serve as a ‚root of trust‘ on a platform. Also they are tested and certified to withstand a defined level of side-channel/observing attacks, semi-invasive/fault attacks and even invasive attacks.

In contrast the term HSM essentially just says „hardware security module“ and this leads to an ambiguity and variety of interpretations.

Traditionally an HSM is module that is optimized to generate AES, RSA or ECC keys and certificates in very high performance. Imagine you run a web-server that shall be able to quickly establish hundreds or thousands of https (SSL/TLS) session. This requires a massive crypto performance (i.e. key generation). HSMs do this - very fast! They are not necessarily well protected sophisticated against attacks, since they are usually operated in a secure environment. However they typically are packaged in a way that provides tamper resistance and evidence. Big difference to TPMs: these modules cost $1000s upwards. It‘s low volume specially designed silicon and comes e.g. on PCIexpress boards where the customer can scale the required performance by plugging in multiple HSMs on his motherboard/rack. The TPM market is north of 100mio pcs/yr. And by definition there is 1 TPM ‚bound‘ (=mostly ‚soldered‘) to the platform.

Other forms of „HSM“ interpretations: Some use the term HSM ambiguously e.g. even for the TrustZone in the ARM-A series family or anything where there is a dedicated security processor in a more general (multi-core) CPU.


If you want to put it short:

  • A TPM is a specific device to keep it's own keys secure (source of identity)
  • while an HSM is a general device to secure foreign keys (verify identity)

As always keep in mind, that things are more complex, so this is an oversimplification.

And the following is not exhaustive, too.

TPM and HSM serve a completey different purpose.

Usually a TPM is used (backed by the BIOS) to verify that all parts of the operating system are authentic. It can be part of some anti-theft method which prevents the computer to boot or decrypt if the wrong person tries to start it. While a TPM protects the information (like it's identity) stored inside it, these information usually is only used infrequently, so a TPM needs low to no power and has a tiny design pattern. A TPM does not meant to protect valuable information outside of the TPM's context, which is the "platform" (AKA mainboard) itself.

In contrast an HSM is meant to protect a huge (compared to what a TPM stores) amount of (often foreign) cryptographic material (outside the "platform") against theft which is also in heavy and critical use. So it's main context is to protect these information, not only itself.

HSM and TPM share some properties. You can store (a small amount of) keys inside a TPM to protect those, too. But while a TPM is a small inexpensive device, an HSM usually is a quite capable and expensive computing device.

Or to put it into computing terms:

With a TPM you can only simulate an HSM. This simulation cannot keep the data inside the simulated HSM secure against hacking.

With an HSM you can emulate a TPM (as long as the HSM is able to run all needed cryptographic routines within itself). So a good HSM could be used to create a software replacement of a TPM in real world with the same security properties of a TPM. This can be used to emulate TPMs for virtual machines, such that these TPMs cannot be cloned by a hacker (outside of the host itself and provided that the HSM is not hacked, too).


TPM chips often are embedded onto a motherboard, but not always. HSM are almost always external.

My motherboard actually supports adding a TPM chip via a header.

TPM can replicate some HSM functionality, but a HSM cannot replace a TPM. TPM allows a root of trust for booting.

  • I don't believe this is true. A TPM is either connected over the LPC bus via a header as you mentioned (dTPM), or is implemented by the chipset firmware itself (fTPM). I am not aware of any TPM implementations that are embedded into the motherboard.
    – forest
    Commented May 25, 2018 at 4:55
  • 1
    @forest Just look at any half-recent laptop with a TPM, they'll always be soldered on to the motherboard due to space. Similarly, look at any enterprise desktop, because TPM is required by Windows 10 logo (since 2016), it's cheaper and more reliable to have it soldered down.
    – user71659
    Commented Aug 28, 2018 at 19:39
  • Oh now I get what you mean. I thought by embedded you meant a component of the motherboard itself, not just a component that has been soldered down.
    – forest
    Commented Aug 29, 2018 at 0:53
  • Some machines have it embedded on motherboard, particularly laptops, and it is not removable while remaining functional.
    – Moscato
    Commented Aug 29, 2018 at 1:34

TPMs are verifying, that computer runs only signed code. It usually builtin motherboard.

HSM used to store private or symmetric keys for encryption.Usually it is separate network deivce.

  • 3
    TPM also can store/generate private keys for encryption, in fact a TPM can be used as a small built-in HSM (but the opposite is not true: an HSM cannot be used as a TPM). Commented May 8, 2015 at 13:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .