A laptop's firmware checks the digital signature on the boot loader before running it. When a technician installs an altered boot loader, the laptop refuses to start.
Protection built into hardware: memory, TPM and HSM
Some protection is built into the chips of a computer rather than added by software. The processor keeps programs out of each other's memory, a small security chip records how the machine started, and a separate hardened device can guard the keys of a whole organisation. No technical background is assumed. A security professional chooses between these capabilities and knows what each one leaves uncovered.
By the end of this unit you will be able to:
- Explain how virtual memory, data execution prevention and address space layout randomisation keep programs apart
- Tell apart volatile and non-volatile memory, and explain why a key can survive in memory after power is cut
- Tell apart secure boot and measured boot
- Name the keys and registers of a trusted platform module and explain binding and sealing
- Choose between a trusted platform module and a hardware security module for a stated need
An encrypted laptop taken from a parked car
An illustrative example
A charity's finance officer closes her laptop lid at the end of the day, which puts it to sleep, and leaves it on the back seat of her car. It is stolen within the hour. The disk is encrypted, and the volunteer who runs the charity's computers tells the trustees there is nothing to worry about.
A week later the charity's bank details are offered for sale. The thief guessed no password. The laptop had stayed powered, and the key that unlocks the disk was still held in its memory.
The disk was encrypted. What made the key reachable, and what setting would have kept it out of memory while the laptop was out of the officer's hands?
Each program gets its own memory
A block of flats gives each household its own front door. A computer treats memory, the chips that hold the programs and , the same way. Each process gets its own private space, and the processor enforces the walls on every access.
Virtual memory gives every process its own set of addresses, which the processor translates into real locations. A process cannot even name memory that belongs to another. Under paging, memory is handed out in fixed-size blocks called pages, each marked with rights such as read-only. Hardware segmentation divides memory into regions of varying size, each with its own bounds.
When RAM fills, the system moves pages it is not using to a file on disk, called the page file or swap space, and brings them back when needed. Anything in memory, a disk key included, can be written there. It stays on the disk after power-off unless the page file is or cleared at shutdown.
These walls answer a common attack. A buffer overflow happens when a program copies more data into a space than the space can hold. The surplus spills into neighbouring memory, and an attacker can shape it into instructions.
- Data execution prevention (DEP)
- Also called no-execute. Memory that holds data is marked as not runnable. If a program tries to run instructions from there, the processor refuses and the process is stopped.
- Address space layout randomisation (ASLR)
- Programs and their parts are loaded at unpredictable addresses. An attacker who planned to jump to a known piece of useful code finds it somewhere else.
Both make an overflow harder to exploit. Neither repairs the faulty program.
Isolation is only as strong as the processor. In 2018 researchers published Meltdown, which let an ordinary program read the operating system's memory, and Spectre, which let one program read another's. Both abused a speed feature that runs instructions before they are known to be needed. Software, firmware and processor updates followed.
Kinds of memory and what lingers after power-off
Memory is volatile if it loses its contents when power is removed, and non-volatile if it keeps them.
| Kind | Keeps data without power | What it holds |
|---|---|---|
| Registers and cache | No | Values the processor is using now, and recently used data kept close to it |
| Random access memory (RAM) | No, but contents fade over seconds | Programs and data in use, including keys for encrypted disks |
| Read-only memory (ROM) | Yes | Code fixed at manufacture, such as the first start-up instructions |
| Programmable ROM (PROM) | Yes | Blank read-only memory written once by the buyer, then fixed |
| Erasable PROM (EPROM) and electrically erasable PROM (EEPROM) | Yes | Read-only memory that can be rewritten. EPROM is erased with ultraviolet light; EEPROM electrically, in place |
| Flash | Yes | Rewritable chips in USB sticks, phones, solid-state drives and firmware stores |
Data remanence is data that remains after an attempt to remove it. RAM was long assumed to empty when power stops. Princeton researchers showed in 2008 that it fades over seconds, and lasts minutes or longer if chilled.
A cold boot attack uses that delay. The attacker cuts power to a running or sleeping machine, restarts it from their own small program, and copies what memory still holds. Disk encryption keys are the usual prize.
Shutting down, rather than sleeping, and requiring a PIN before the operating system starts keep the disk key out of memory while a device is unattended.
Secure boot and measured boot
Start-up is a chain. The firmware runs first, then the boot loader, a small program that finds and starts the operating system. The older firmware design is the Basic Input/Output System (BIOS). Its successor, the Unified Extensible Firmware Interface (UEFI), can check on the code it starts.
Malware placed early in the chain runs before any security software and can hide from it. Every chain therefore begins at a root of trust: a small piece of code, usually in read-only memory, trusted because it cannot be changed. Two capabilities build on it.
- Secure boot
- Each stage checks the digital signature on the next before running it. The firmware holds a list of approved publishers' keys and a list of forbidden ones. A stage that fails the check is refused, and start-up stops.
- Measured boot
- Each stage computes a of the next and records it in the security chip before running it. Start-up continues whatever the result. The record is used later, to release a key only if nothing changed or to prove the machine's state to another system.
Secure boot blocks a bad stage; measured boot records it
Read this figure as text
Start-up is a chain that begins at a root of trust, a small piece of code in read-only memory that cannot be changed. Secure boot and measured boot both build on it and do different things with each stage.
- The root of trust runs first and starts the UEFI firmware.
- Secure boot: each stage checks the digital signature on the next before running it, against a list of approved publishers' keys and a list of forbidden ones. The figure draws this check once, before the boot loader.
- A stage that fails the signature check is refused, and start-up stops. A boot loader that passes is run.
- The boot loader, a small program that finds and starts the operating system, starts it in the same way.
- Measured boot: each stage computes a hash of the next and records it in the TPM's platform configuration registers before running it. Start-up continues whatever the result.
- The record is used later: the TPM sends a signed statement of the register values to a remote checker, which compares them with known good values, or a key is released only if nothing changed.
- Secure boot blocks: an altered stage does not run. Measured boot records: an altered stage runs, and the record shows it.
Secure boot blocks: an altered stage does not run. Measured boot records: an altered stage runs, and the record shows it.
The TPM: a chip that vouches for one computer
A trusted platform module (TPM) is a security chip fixed to one computer's main board, or a separated function inside the main chipset. Its specification, from the Trusted Computing Group, is published as ISO/IEC 11889. It makes and keeps keys whose private parts never leave it, and holds the record.

A trusted platform module is one small chip, about a centimetre long, soldered to a laptop's main board, so it vouches for that one computer.
- 1Main board. The computer's own circuit board. The chip's legs are soldered to it.
Photograph: Lenovo N20 Chrome - motherboard - Infineon SLB9655TT12-49890 by Raimond Spekking, CC BY-SA 4.0. Resized.
- Endorsement key
- A key pair placed in the by its maker, with the maker's . It proves the chip is a genuine TPM. Its private half never leaves the chip.
- Storage root key
- The TPM's master wrapping key. Other keys are encrypted under it, so they can be stored outside the chip and still be used only inside it.
- Attestation identity key
- A key that signs reports of the machine's state. Each checker sees a different one, so checkers cannot pool what they learn to track one device.
- Platform configuration registers (PCRs)
- Slots that hold the start-up measurements. Each new measurement is folded into the value already there, never written over it, so no later stage can erase an earlier record. They clear on restart.
Binding encrypts a key or data so that only this one TPM can decrypt it. Sealing adds a condition: the TPM decrypts only if the registers hold the same values as when the data was sealed. A disk key sealed in this way is released only if the start-up chain is unchanged.
In remote attestation, the TPM signs a statement of its register values and sends it to another system. That system compares the values with known good ones before admitting the device, for example to the company network.
A TPM also locks for a period after a set number of wrong PINs, so a short PIN resists guessing.
The HSM: a vault for many systems' keys
A hardware security module (HSM) is a separate, hardened device that creates, stores and uses for many systems. It is a network appliance or a card inside a server. Keys are made inside it and never leave in readable form: applications send it data to sign or , and it returns the result.
Its casing shows and resists any attempt to open it, and the more strongly rated models erase their keys when they detect one. HSMs are tested against FIPS 140, the United States standard for modules. and banks keep their signing and card keys in them.
With so many systems depending on it, one HSM is a single point of failure. HSMs are installed in pairs or clusters with keys backed up in protected form. That gives fault tolerance: the service keeps running when one unit fails.
| Point | Trusted platform module | Hardware security module |
|---|---|---|
| Whose keys | One computer's own keys | Keys shared by many systems or a whole organisation |
| Form | A low-cost chip or chip function on the board | A separate appliance or plug-in card, costly and hardened |
| Main jobs | Measured boot record, sealing, attestation, protecting a disk key | Creating, storing and using keys at volume, such as for signing |
| Typical use | A laptop's disk encryption and device identity | A certificate authority, a payment system, a cloud key service |
Encryption and isolation built into the device
Full disk encryption (FDE) encrypts everything on a drive, including the operating system, so a drive lost while switched off reveals nothing. Software can do it, or the drive's own controller.
A self-encrypting drive (SED) encrypts inside the drive, with no part played by the operating system. It asks for authentication before the operating system loads, cannot be switched off, and costs almost no speed.
Intel's AES New Instructions (AES-NI) carry out the Advanced Encryption Standard, a standard encryption method, in the processor itself. Encryption becomes cheap enough to leave on everywhere.
A trusted execution environment (TEE), also called a secure enclave, is an area of processor and memory that the processor itself protects. Nothing outside can read the code and data inside, not even the operating system or an administrator. Cloud services use enclaves to hide a customer's data from the provider's staff while it is processed.
Common misconception
“Full disk encryption protects a laptop whenever it is out of the owner's sight.”
It protects the data while the machine is off or the drive is locked. Once the owner has signed in, or while the laptop sleeps, the key is in memory and the files can be read.
A question, worked through
A payment company runs forty servers that each sign transaction records with the same company signing key. An audit finds the key stored as a file on every server. The head of security must put the key where it cannot be copied, and all forty servers must keep signing without interruption.
Where is the BEST place to hold the signing key?
Decide on your answer, then open the reasoning
- The decisive facts are one key shared by many servers, a need that it cannot be copied, and a need for constant service.
- Rule out c. A self-encrypting drive protects data while the server is off. A running server reads the file in the clear, and forty copies remain.
- Rule out b. A TPM protects one computer's own keys. Sealing a copy on every server still leaves forty copies of a key that had to be imported into each.
- Between a and d: an enclave protects the key while one processor uses it, yet the key must still be handed to forty enclaves. A hardware security module keeps one key inside one hardened, tested device that never releases it.
- Option a also meets the service need, because a cluster keeps signing when one unit fails.
Answer: A. In a clustered hardware security module that all forty servers call
Choosing between good answers
- A question concerns the keys of one computer, such as its disk key or its proof of identity
- think TPM. When the keys serve many systems or a whole organisation, think HSM.
- Start-up must stop if any stage has been altered
- choose secure boot. Measured boot records each stage and reports it later; it does not stop start-up.
- A protection assumes memory is empty once power is cut
- allow for remanence. Prefer shutting down and a PIN before start-up to leaving a device asleep.
- An attack injects instructions into an area that holds data
- data execution prevention stops them running and ASLR hides the target. Correcting the faulty code is the root cure.
Check your understanding
5 questions on this unit, easiest first. Confirm an answer to see the reasoning for it, then the right answer, the other options and the rule to reuse. Your answers are kept in this browser and feed readiness and review.
These questions are drafts that no named reviewer has approved yet.
Question 1 of 5
What to remember
- Virtual memory gives each process its own addresses. Data execution prevention refuses to run instructions from data areas, and ASLR makes addresses unpredictable.
- Meltdown and Spectre showed that isolation enforced by the processor can itself fail, and must be patched like software.
- RAM is volatile but fades over seconds, longer when cold. A running or sleeping machine can give up its disk key to a cold boot attack.
- Secure boot refuses a stage whose signature fails. Measured boot records each stage's hash in the TPM and lets start-up continue.
- A TPM belongs to one computer: endorsement key, storage root key, attestation keys, PCRs, binding, sealing and remote attestation.
- An HSM is a separate tamper-resistant device that holds and uses keys for many systems, tested against FIPS 140 and clustered for fault tolerance.
Say it from memory
Name the security capabilities that hardware gives an information system, and say how a TPM differs from an HSM.
Memory protection: virtual memory, paging, segmentation, data execution prevention and ASLR. Trusted start-up: secure boot blocks an altered stage; measured boot records it in the TPM. The TPM is one computer's chip: endorsement and storage root keys, PCRs, binding, sealing, remote attestation. An HSM is a separate hardened device holding keys for many systems. Built-in encryption: self-encrypting drives, AES-NI and enclaves.
What is a buffer overflow, and what do data execution prevention and ASLR each do against it?
A program copies more data into a space than it can hold, and the surplus spills into neighbouring memory, where an attacker can shape it into instructions. Data execution prevention marks data memory as not runnable. ASLR loads programs at unpredictable addresses. Both make an overflow harder to exploit; neither repairs the faulty program.
What is data remanence, and how does a cold boot attack use it?
Data remanence is data that remains after an attempt to remove it. RAM fades over seconds after power stops, and lasts minutes or longer if chilled. A cold boot attacker cuts power, restarts from their own small program and copies what memory still holds, usually disk encryption keys.
How does secure boot differ from measured boot, and where does each chain begin?
In secure boot each stage checks the digital signature on the next and refuses one that fails, so start-up stops. In measured boot each stage hashes the next and records it in the security chip, and start-up continues whatever the result. Both begin at a root of trust: small code, usually in read-only memory, that cannot be changed.
What is a hardware security module, what standard is it tested against, and why is it installed in pairs or clusters?
A separate, hardened device that creates, stores and uses cryptographic keys for many systems; keys never leave it in readable form. HSMs are tested against FIPS 140. One HSM is a single point of failure, so pairs or clusters with protected key backups give fault tolerance.
What is a self-encrypting drive, and what is a trusted execution environment?
A self-encrypting drive encrypts inside the drive, with no part played by the operating system, asks for authentication before the operating system loads and cannot be switched off. A trusted execution environment, or secure enclave, is processor and memory protected by the processor itself, so nothing outside can read its code and data, not even an administrator.
Sources
- Data Execution Prevention, MicrosoftData execution prevention marks data pages as non-executable, ends a process that runs code from them, and makes buffer overruns harder to exploit.
- Exploit protection reference, MicrosoftAddress space layout randomisation denies an attacker knowledge of the memory layout needed to run code already in memory.
- Meltdown and Spectre, Graz University of TechnologyMeltdown breaks the isolation between user programs and the operating system; Spectre breaks the isolation between programs; both are addressed by patches.
- NIST IR 8320: Hardware-Enabled Security: Enabling a Layered Approach to Platform Security for Cloud and Edge Computing Use Cases, NISTSpeculative reads as the basis of the processor cache attacks; the chain of trust rooted in immutable read-only memory; UEFI Secure Boot with its database of approved and forbidden keys; trusted execution environments and enclaves; AES-NI.
- Lest We Remember: Cold Boot Attacks on Encryption Keys, Halderman and others, USENIX Security Symposium 2008RAM keeps its contents for seconds after power loss and much longer when cooled, allowing disk encryption keys to be recovered by a cold reboot.
- NIST SP 800-88 Rev. 2: Guidelines for Media Sanitization, NISTVolatile storage loses its contents when power is removed; non-volatile storage keeps them; RAM, ROM and flash as kinds of storage.
- TCG Guidance for Securing Industrial Control Systems Using TCG Technology, Trusted Computing GroupSecure boot refuses to start on a failed signature check; measured boot stores hashes in a TPM and does not stop a corrupted system from starting.
- Trusted Platform Module (TPM) fundamentals, MicrosoftThe storage root key, the endorsement key, binding (wrapping) keys to the TPM, sealing to platform measurements, and lockout after repeated authorisation failures.
- How Windows uses the TPM, MicrosoftTPMs as discrete chips or integrated functions, ISO/IEC 11889, the endorsement key certificate, attestation identity keys, measurements that cannot be erased until restart, and remote attestation by a signed quote.
- NIST CSRC Glossary: hardware security module (HSM), NISTA hardware security module is a physical device that safeguards and manages keys and performs cryptographic processing, tamper-evident and intrusion-resistant, with FIPS 140 requirements.
- FIPS 140-2: Security Requirements for Cryptographic Modules, NISTTamper evidence at security level 2, and erasure of keys on detected intrusion at levels 3 and 4.
- NIST CSRC Glossary: fault tolerance, NISTFault tolerance as the ability of a system to keep running when one or more components fail.
- NIST SP 800-111: Guide to Storage Encryption Technologies for End User Devices, NISTFull disk encryption, and hardware-based full disk encryption done by the drive itself with pre-boot authentication, no operating system part, and little performance cost.