Ambimat GroupAmbimatAmbiSecureeSIM InitiativeEngineering BlogAhmedabad · India · Est. 1981

Secure Element vs TPM vs HSM — Where Each Fits

All three are "hardware that stores keys". They are not interchangeable. Picking the wrong one is the difference between a credential that works in production and an architecture decision you walk back six months later.

If you have ever sat in a design review where someone said "we’ll just use an HSM" and someone else said "but we already have a TPM" and a third person said "what about a secure element?" — this post is the disambiguation. We’ll define each, draw the boundaries, and walk through the deployments each is built for.

Three definitions, locked down

Secure element (SE)

A tamper-resistant chip whose entire purpose is to store keys and run cryptographic operations on those keys. Typically Common Criteria EAL5+ certified. Lives on the BOM of a device — a smart card, an IoT controller, a phone’s SoC. Talks to its host over a small interface (ISO/IEC 7816, I2C, SPI). Examples: NXP A71CH/SE050, ST33, Infineon SLE / SLI series, the secure-element die in iPhones and Pixels.

Trusted Platform Module (TPM)

A specific specification (TCG TPM 2.0) for a chip or firmware module that lives on a PC motherboard. Standardised command set, standardised key hierarchy, standardised PCR-based measured-boot model. Designed to attest to a platform’s software state and to bind keys to that state.

Hardware Security Module (HSM)

A rack-mount or USB-attached cryptographic appliance designed for backend / server-side key operations. FIPS 140-3 Level 3 or Level 4 typical. Performs thousands to tens of thousands of cryptographic operations per second. Examples: Thales Luna, Entrust nShield, AWS CloudHSM, YubiHSM2 (low end).

Three different chip classes for three different deployment contexts.

Quick comparison

PropertySecure elementTPMHSM
Where it livesInside a deviceOn a PC/server motherboardIn a data centre / rack
Typical certificationCC EAL5+ / FIPS 140-3 L2-3FIPS 140-2 L1-2 / TPM 2.0 certFIPS 140-3 L3-L4 / CC EAL4+
ThroughputLow (a few ops/s typical)Low (a few ops/s typical)High (10’000s+ ops/s)
Designed forPer-device identity, smart cardsPlatform attestation, boot integrityBulk crypto, CA root, KMS
Per-unit costLow (cents to a few dollars)Low (often bundled with CPU)High (USD thousands per unit)
Software ecosystemJavaCard / GP / vendor SDKTPM 2.0 spec (TSS, tpm2-tools)PKCS#11 / KMIP
Tamper-evidenceSide-channel + fault-injection resistanceModest physical protectionActive anti-tamper, zeroisation

When you want a secure element

Secure elements are designed for the case where the chip is going to ship inside something else — a card, a controller, a phone — and stay there for the device’s lifetime. You pick a secure element when:

  • You want per-device unique key material with provable hardware binding.
  • You need high physical-attack resistance — differential power analysis, fault injection, microprobing — because the device might end up in adversarial hands.
  • You can fit a few cents to a few dollars onto the BOM.
  • Throughput is not the limit (a few signing operations per minute, not per second).
  • The cryptographic operations are well-defined and stable for the device’s lifetime.

Smart cards are the canonical secure-element deployment: a card-shaped device whose only reason to exist is to hold a key in a tamper-resistant chip. IoT-device identity is the next biggest, where the secure element lives on the device’s main board and holds the device-identity key. See our case study on this exact pattern.

When you want a TPM

TPMs are specifically the chip class you want for PCs, servers, and laptops. The defining feature is the Platform Configuration Register (PCR) machinery and the measured-boot model.

  • You want to bind a key to the platform’s software state. A TPM can refuse to release a key unless the boot chain measures to the expected value, which is hard to do with a secure element designed for portable cards.
  • You want remote attestation of the platform. TPM 2.0’s Quote operation gives you a signed statement of the PCR values; you can verify your laptop fleet boots clean.
  • You want endorsement-key-rooted identity per machine. Every TPM ships with a manufacturer-signed endorsement key that uniquely identifies the chip.
  • You need Windows Hello / BitLocker / DICE — these are designed around the TPM, not around the smart-card stack.

TPMs are also FIDO2 platform authenticators on most modern PCs — that’s how "Windows Hello" implements WebAuthn. The same TPM is doing measured boot, BitLocker, and FIDO platform authentication.

When you want an HSM

HSMs are the right answer when the key needs to stay on a server, the throughput needs to be high, and the certification bar needs to be FIPS 140-3 Level 3 or higher. Classic deployments:

  • Root CA. The signing key of your issuing PKI never leaves the HSM in cleartext.
  • Code signing. Same logic; the code-signing key is signed by an HSM.
  • Payment HSM. EMV, ATM, P2PE flows all require FIPS 140-3 L3+ HSMs because the card networks require them.
  • Cloud KMS / KMS-as-a-service. The big-three cloud KMS offerings are HSM-backed.
  • SAM personalisation. Master keys for transit / closed-loop systems live in an HSM at the operator’s data centre, get derived into per-card keys, and never escape.

HSMs are expensive and operationally heavy — cluster, replicate, partition, audit, key-ceremony — but for backend keys at scale there is no substitute.

How they interact in a real system

A realistic identity stack uses all three together:

  1. HSM at the issuing CA holds the CA signing key. Signs device certificates.
  2. Secure element on each device holds the device-identity key. Generated on-chip; never leaves.
  3. TPM in each user’s laptop holds the platform-bound user authenticator key. Used as a FIDO2 platform authenticator.

None of the three could replace the other two in this stack. The HSM can’t live on the device (cost, size, power). The secure element can’t hold the CA root (throughput). The TPM can’t live on an IoT controller (form factor and ecosystem).

When each one is wrong

MistakeSymptomWhat to use instead
Using a TPM as a smart-card replacementYou can’t move credentials between machines; lost laptop = lost credential.Secure element / smart card / USB key.
Using a secure element as a backend CAThroughput collapses under load; cert issuance becomes the bottleneck.HSM.
Using an HSM in every deviceBOM cost explodes; physical-attack resistance is wrong for the threat model.Secure element.
Treating "FIDO2 authenticator" as if it’s all the sameMixed TPM / SE / passkey fleet without policy — AAGUID drift, recovery problems.Pin AAGUIDs per account class.
Skipping the secure element on a 10-year IoT deviceKey extraction from a single physical unit becomes a fleet-wide vulnerability.Add the secure element. Always.

Certification landscape

The certification bodies and their grades, briefly:

Common Criteria (CC)

The international standard for security evaluation, run under ISO/IEC 15408. Smart-card secure elements typically target EAL5+ or EAL6+, including side-channel and fault-injection resistance. The Protection Profile for a smart-card SE is well-defined and stable.

FIPS 140-3

The US federal cryptographic-module certification. Replaces FIPS 140-2. Levels 1-4. HSMs typically target Level 3 or Level 4. Secure elements and TPMs target Level 1-3 depending on form factor.

TPM 2.0 specification

TCG’s own specification. A TPM compliance certification confirms a chip implements the spec. Doesn’t override FIPS / CC — many TPMs are also FIPS-certified.

Cost realism

  • Secure element (silicon, volume): single-digit USD or less.
  • TPM (silicon, volume): usually a few USD; often bundled with the platform.
  • HSM (network-attached, certified): low five to high six figures USD per unit, plus integration cost.
  • HSM-as-a-service (AWS CloudHSM / Azure Dedicated HSM / Google Cloud HSM): per-hour billing; cheaper to start, more expensive at sustained scale.

Avoid the trap of "we’ll use the cloud KMS, no HSM needed". Cloud KMS is HSM-backed; you’re using one, you just don’t see it.

Practical pitfalls

  1. Confusing FIPS levels. A FIPS 140-2 Level 1 module is fundamentally a "the cryptography is implemented correctly" certification, not a "tamper-resistant hardware" certification. Level 2 adds tamper-evidence; Level 3 adds tamper-detection-with-zeroisation; Level 4 adds environmental attack resistance.
  2. Assuming TPMs are interchangeable across vendors. They follow the same spec, but firmware bugs, attestation root differences, and PCR semantics vary. Pin to the vendors you’ve tested.
  3. Believing "we have an HSM" means CA security. The HSM is necessary but not sufficient. CA security is about M-of-N ceremony, key-ceremony auditability, and key-custody hygiene — the HSM just keeps the key from leaving the box.
  4. Letting throughput limits hide. Secure elements are slow. A device that needs to sign 100 telemetry messages per second can’t use a single secure element; you either batch, or you cache derived session keys, or you pick a different architecture.
  5. Skipping the supply-chain trust step. A counterfeit secure element from a grey-market reseller will not match the manufacturer’s attestation root. Sourcing matters; chain-of-custody matters.

A short decision tree

  1. Is the key on a server? ? HSM. Don’t consider anything else.
  2. Is the key on a PC / laptop, bound to platform integrity? ? TPM.
  3. Is the key on a portable card or an embedded device? ? Secure element.
  4. Do you need cross-machine portability? ? Smart card / FIDO key, not TPM.
  5. Do you need to attest to the boot chain? ? TPM, not secure element.
  6. Do you need thousands of signatures per second? ? HSM, not secure element.

Picking the right hardware root for a new product line?

Bring your BOM constraints and your threat model. We’ll bring an architecture sketch in a week.

Talk to engineeringEngagement models