SECURITY ENGINEERING · PART 1 · LINUX AND WINDOWS, FROM THE INSIDE · INTERNALS · 16 OF 229

Secure Boot, TPM and Disk Encryption Explained

Protecting a machine from the hardware up: why a stolen or tampered device is a serious threat, how Secure Boot checks each stage of startup is signed, what a TPM is and how it stores keys and measures boot, full-disk encryption with BitLocker and LUKS, how the TPM unlocks the disk only on a trusted boot, and the limits these controls do and do not cover.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 9
  9. 10
  10. 11
  11. 12
  12. 13
  13. 14
  14. 15
  15. 16
  16. 17
  17. 18
  18. 19
  19. 20
  20. 21
  21. 22
  22. 23
  23. 24
  24. 25
  25. 26
  26. 27
  27. 28
  28. 29
  29. 30
  30. 31
  31. 32
  32. 33
  33. 34
  34. 35
  35. 36
  36. 37
  37. 38
  38. 39
  39. 40
  40. 41
  41. 42
  42. 43
  43. 44
  44. 45
  45. 46
  46. 47
  47. 48
  48. 49
  49. 50
  50. 51
  51. 52
  52. 53
  53. 54
  54. 55
  55. 56
  56. 57
  57. 58
  58. 59
  59. 60
  60. 61
  61. 62
  62. 63
  63. 64
  64. 106
  65. 107
  66. 108
  67. 109
  68. 110
  69. 111
  70. 112
  71. 113
  72. 114
  73. 115
  74. 116
  75. 117
  76. 118
  77. 119
  78. 120
  79. 121
  80. 122
  81. 123
  82. 124
  83. 125
  84. 126
  85. 127
  86. 128
  87. 129
  88. 130
  89. 131
  90. 132
  91. 133
  92. 134
  93. 135
  94. 136
  95. 137
  96. 138
  97. 139
  98. 140
  99. 141
  100. 142
  101. 143
  102. 144
1 / 11

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • Physical access bypasses the OS
  • Secure Boot verifies startup
  • TPM guards keys and measures boot
  • encrypt disks
  • auto-lock

Notes

The physical threat

Start with the threat. With physical access, an attacker ignores your permissions. They boot from a USB stick and read your disk directly, because file permissions are enforced by the OS they just skipped. They pull the drive and mount it elsewhere. Or they tamper with the bootloader to capture your password next time, the evil-maid attack. The answers: encrypt the disk so the data is unreadable, and verify the boot chain so tampering is caught.

What physical access allows
  • boot from USB, read the disk directly — your file perms do not apply
  • pull the drive, mount it elsewhere
  • tamper with the bootloader to plant a backdoor (evil maid)
  • so: encrypt the disk, and verify the boot chain

Secure Boot

Secure Boot, a feature of modern UEFI firmware, checks that each stage of startup is signed before it runs. The firmware only launches a signed bootloader, the bootloader only launches a signed kernel, and the signatures chain back to keys held in the firmware. If an attacker swaps in a tampered bootloader or kernel, the signature does not match and the machine refuses to boot it. That defeats bootkits, malware that loads before the operating system, and many evil-maid tampering attacks.

Secure Boot (UEFI)
  • firmware only runs a signed bootloader
  • the bootloader only runs a signed kernel
  • signatures chain to keys in the firmware
  • result: unsigned or tampered boot code is refused
  • defeats bootkits and many evil-maid attacks

The TPM

The Trusted Platform Module, or TPM, is a small secure chip separate from the main processor. It does two security jobs. It stores cryptographic keys in hardware, so they never sit in normal memory or on disk where malware could read them. And it measures each stage of boot into special registers, building a fingerprint of exactly how the machine started. It can then be told to release a secret only if that fingerprint matches a known-good boot. That is what ties encryption to a trusted startup.

Trusted Platform Module
  • a secure chip, separate from the CPU
  • stores keys so they never touch normal memory or disk
  • measures each boot stage into registers (PCRs)
  • can release a secret only if the measurements match a known-good boot
  • basis for BitLocker + Linux measured boot

Full-disk encryption

Full-disk encryption is the answer to a stolen drive. BitLocker on Windows, LUKS with dm-crypt on Linux, encrypt the entire volume at rest, so without the key the disk is just random bytes. The important question is where the key lives. It can be protected by the TPM, by a PIN or passphrase, or by a recovery key kept safe elsewhere. The strongest common setup is the TPM plus a PIN, so the disk unlocks only on the right machine and only when the person also knows the PIN.

BitLocker and LUKS
  • Windows: BitLocker
  • Linux: LUKS/dm-crypt
  • the whole volume is encrypted at rest
  • without the key, a stolen drive is random bytes
  • key protected by the TPM, a PIN/passphrase, or a recovery key — ideally TPM plus a PIN

How it fits together

Here is how the pieces combine. Secure Boot starts a signed chain. The TPM measures each stage into its registers. If those measurements match a trusted boot, the TPM releases the disk-encryption key and the system unlocks normally. But if an attacker tampered with the bootloader or kernel, the measurements differ, the TPM withholds the key, and the disk stays locked. So the data is protected not just by encryption, but by encryption that only unlocks on a machine that booted the way it should.

The chain
  • 1 firmware + Secure Boot start a signed chain
  • 2 TPM measures each stage
  • 3 if the measurements match a trusted boot, the TPM releases the disk key
  • 4 tampered boot → measurements differ → key withheld → disk stays locked

The limits

Be clear about the limits. These controls protect data at rest and the integrity of boot. They do nothing once the machine is unlocked and running: then the data is readable, and OS controls take over. So a thief who steals an awake, logged-in laptop is not stopped by disk encryption. There are also niche hardware attacks, like cold-boot and DMA, largely mitigated on modern devices. And the recovery key is a master key: store it safely but keep it secret.

Know the gaps
  • they protect data at rest and the boot chain
  • once unlocked and running, the data is readable; OS security takes over an awake, logged-in laptop is not protected by encryption
  • cold-boot/DMA attacks exist (mitigated by modern HW)
  • keep the recovery key secret

In practice

In practice, turn these on everywhere. Enforce full-disk encryption on every laptop through device management, so it is not optional (Part twelve). Encrypt server disks too, especially anything outside your own data centre. Keep Secure Boot on and the TPM in use. Add a lock screen and a short auto-lock, which closes the awake-laptop gap for a device left unattended. And escrow recovery keys in a central, access-controlled system, so you can recover a device without leaving keys around.

The checklist
  • laptops: BitLocker / LUKS on, enforced by device management
  • servers: encrypt disks, especially off-prem
  • Secure Boot enabled
  • TPM present and used
  • lock screen + short auto-lock (covers the awake-laptop gap)
  • escrow recovery keys centrally, access-controlled

Common mistakes

Mistakes. Shipping laptops with no disk encryption, so a loss is a breach. Disabling Secure Boot to make some driver work and never re-enabling it. Having a TPM but not using it, so the disk key rests on a weak passphrase. Storing recovery keys in a shared spreadsheet, turning the master keys into the easiest target. No auto-lock, so every unattended awake laptop is open. And putting servers in third-party or edge locations with unencrypted disks, where physical access is far more likely.

Avoid these
  • laptops with no disk encryption
  • Secure Boot disabled "to make something work"
  • TPM unused, key only a weak passphrase
  • recovery keys in a spreadsheet
  • no auto-lock, so awake = open
  • servers off-site unencrypted

Say it like this

In the interview: I protect a lost or stolen device with full-disk encryption, BitLocker or LUKS, with the key sealed to the TPM plus a PIN so the disk unlocks only on the right machine and only on an untampered boot. Secure Boot verifies the boot chain to defeat bootkits and evil-maid tampering. I enforce encryption through device management so it is never optional, add a short auto-lock to cover an awake laptop left unattended, and escrow recovery keys in a central access-controlled store.

In the interview
  • "Full-disk encryption, BitLocker
  • or LUKS, with the key sealed to the TPM plus a PIN, so the disk
  • unlocks only on an untampered
  • boot. Secure Boot verifies the boot chain against evil-maid
  • attacks. I enforce it via device
  • management, add short auto-lock, and escrow recovery keys."

Interview questions

Q1Why do physical-access attacks need separate defenses?

File permissions and OS controls are enforced by the operating system, which a physical attacker simply bypasses by booting their own media, removing the drive, or tampering with the bootloader. Disk encryption and boot verification protect the device when the OS is not in control.

Q2What is Secure Boot?

A UEFI feature that verifies each startup stage is signed by a trusted key before running it: firmware runs only a signed bootloader, which runs only a signed kernel. Tampered or unsigned boot code is refused, defeating bootkits and many evil-maid attacks.

Q3What is a TPM and what does it do for security?

A Trusted Platform Module is a dedicated secure chip that stores cryptographic keys in hardware (so they never touch normal memory or disk) and measures each boot stage into registers. It can release a secret only if those measurements match a known-good boot.

Q4How does full-disk encryption protect a device?

Tools like BitLocker (Windows) and LUKS/dm-crypt (Linux) encrypt the whole volume at rest, so without the key a stolen drive is unreadable random bytes. The key is protected by the TPM, a PIN or passphrase, or a recovery key.

Q5How does the TPM tie encryption to a trusted boot?

The TPM measures the boot stages and releases the disk-encryption key only if the measurements match a trusted configuration. If the bootloader or kernel was tampered with, the measurements differ, the key is withheld, and the disk stays locked.

Q6What do secure boot and disk encryption NOT protect against?

They protect data at rest and boot integrity, but not a machine that is already unlocked and running, where data is readable and OS controls apply. A stolen awake, logged-in laptop is not protected by disk encryption, so short auto-lock matters.

Q7Why is TPM plus a PIN stronger than TPM alone for BitLocker?

TPM alone unlocks the disk automatically on the correct, untampered machine, so a thief who powers it on may reach the login screen with the volume already decrypted. Adding a PIN requires something the person knows, so the disk will not unlock from power-on alone.

Q8How should disk-encryption recovery keys be handled?

Escrow them in a central, access-controlled system (key escrow) rather than a shared spreadsheet, so devices can be recovered without scattering master keys. The recovery key can decrypt the disk, so it must be protected as a high-value secret.