Skip to main content
Be Bitwise

Hardware Root of Trust

Low-Level Authentication & Crypto Hardware · Security Fundamentals track

4 min read

In this module

Trust Has to Start Somewhere

Every security system eventually leans on something it trusts without checking. In software-only security, that something is the OS kernel — and if the kernel itself is owned, the foundation goes with it. Hardware roots of trust nail the chain to a physical anchor: silicon that software attacks can't reach.

The TPM: Trusted Platform Module

The TPM is a dedicated security coprocessor — either a discrete chip soldered to the motherboard, or firmware running inside a protected execution environment (fTPM). It does three things well: secure key storage, platform measurement, attestation.

Secure key storage: the TPM generates RSA and ECC key pairs internally. The private half never leaves the chip; signing and decryption all happen inside the TPM boundary. Even an attacker with full control of the OS can't extract the private key. They can ask the TPM to use it on their behalf, but only when access policies allow.

Platform Configuration Registers (PCRs): a bank of registers (typically 24) holding hash measurements of the boot process. PCRs are extend-only — you can hash new data into one, but you can't write an arbitrary value or reset it short of a reboot. That guarantees PCR values reflect the actual sequence of software that booted.

text
PCR[n] = Hash(PCR[n] || new_measurement)
Boot sequence measurements:
PCR[0] = Hash(BIOS/UEFI firmware)
PCR[1] = Hash(BIOS configuration)
PCR[4] = Hash(bootloader code)
PCR[5] = Hash(bootloader configuration)
PCR[8] = Hash(kernel code)

Attestation: the TPM can sign PCR values with its private attestation key, producing a quote a remote verifier can check. The verifier compares against the PCR values it expects for a trusted configuration, catching any boot component that's been tampered with.

Measured Boot vs Secure Boot

Measured boot writes down what booted, but it doesn't stop unauthorised code from running. Secure boot actively blocks unauthorised code by verifying signatures before executing each stage. Different jobs: measured boot lets you detect tampering after the fact (via attestation), secure boot stops the bad bits running at all. Modern systems usually run both.

Secure Boot Chains

Secure boot strings together a cryptographic verification chain that runs from hardware to the live OS:

At each step, the running code checks the next stage's signature before handing over control. If verification fails the boot stops dead. The root of trust is normally a public-key hash burned into one-time programmable fuses at the factory.

HSMs: Hardware Security Modules

HSMs are tamper-resistant boxes built specifically for managing cryptographic keys and running crypto operations. Where TPMs are passive components on a motherboard, HSMs tend to be standalone units or PCI cards living in data centres and financial systems.

What you get from an HSM:

  • Key generation using hardware random number generators
  • Key storage in tamper-resistant memory — the device wipes keys when it senses physical tampering
  • Cryptographic operations performed entirely inside the HSM boundary
  • Access control with multi-factor authentication on administrative operations
  • FIPS 140-2/3 certification — government-certified security levels

HSMs are the backbone for certificate authorities (root CA keys), payment processing (PIN encryption keys), and anywhere a key compromise would qualify as a disaster.

The Boot Trust Problem

Hardware roots of trust answer the chicken-and-egg problem at the heart of secure boot: how do you trust software when software can be compromised? You start from something that isn't software.

The CPU's boot ROM is mask-programmed at the fab and software cannot rewrite it. It carries the minimal code to load and verify the first bootloader. The verification key lives in OTP fuses programmed once during manufacture, never changing afterwards. From that immutable seed, a chain of signatures grows out through every later boot component.

The chain is only as strong as its weakest link. A vulnerability in the boot ROM — checkm8 in Apple's A-series, for example — sinks everything downstream, because there's no patching ROM. Boot ROM code has to be extremely lean and obsessively audited. It's the one component that gets exactly one shot at being right.

fTPM vs dTPM

A discrete TPM (dTPM) is a standalone chip with its own processor and memory. A firmware TPM (fTPM) runs as trusted firmware inside the CPU's secure execution environment — ARM TrustZone, say, or Intel's Management Engine. fTPMs are cheaper and dominate consumer devices, but they share silicon with the main processor, which means CPU-level vulnerabilities can hit them in ways a discrete chip wouldn't notice.