bitlocker-security-data-encryption
bitlocker-security-data-encryption
Tuomas Aura
CS-C3130 Information security
2
Data encryption
▪ Scenarios:
– lost and stolen notebook computers
– stolen workstations and servers
– decommissioning hard drives
→ Risk of disclosure of confidential data
▪ The obvious solution: encrypt data on drive
4
FILE ENCRYPTION
Simple file encryption
1. User enters 1
*****
passphrase **
2. Passphrase hashed
SHA-256 or PBKDF2
to produce a key
2
3. File encrypted with the key
– Symmetric encryption,
e.g. AES in CBC mode
– Integrity check with d70f3 Our
HMAC or AES-GCM 619a plan
209b 3 is.…
6
Limitations of file encryption
▪ User action needed, and users are lazy
– Automation (scripting) is difficult. How to store passphrase?
▪ Passphrase can be brute-forced
▪ After encryption, what happens to the old plaintext file?
▪ Software creates temporary files and backup copies
– Unencrypted file versions and data fragments may be left on disk
▪ Incompatibility with advanced services:
– Background processing like search indexing
– Cloud storage and sharing
Difficulty of deleting files
▪ Deleting a file marks the space free but does not erase data
▪ Overwriting a file does not always erase the old contents
– Unpredictable file system behavior: backups, version history, RAID,
copy on write, journal, bad blocks etc.
– Solid-state disks (SSD) avoid rewriting the same physical blocks
8
Wiping files
▪ Overwriting all free disk space Windows:
cipher.exe /W D:\
– Must write pseudorandom data, not just zeros or ones
– Should read and verify after write
– Erases most data, but no 100% guarantee (e.g. SSD overprovisioning
can hide up to 20% capacity)
– Magnetic data remanence on magnetic media
▪ Physical destruction
– Heating magnetic medium above its Curie temperature
– Grinding SSD or disks to fine powder
9
SSD overprovisioning example
10
ENCRYPTING FILE SYSTEM
Windows encrypting file system (EFS)
▪ Encryption is a file attribute
in NTFS
▪ Enable encryption for a
folder → new files
encrypted from start
▪ Files can be read when the
user is logged in
▪ Encryption and decryption
are transparent to
applications
12
*) DPAPI = Data Protection API
OK
Username
*********
Domain
13
EFS ANALYSIS
EFS limitations: partial protection
▪ Encrypts contents of specific files and folders
▪ Some data is not encrypted:
– Folder and file names
– EFS-unaware software may create backup copies, temp files
– Registry, system files and logs cannot be encrypted
– Page file can be encrypted but requires policy configuration
– Search index, if you has chosen to index the encrypted files
18
FULL DISK ENCRYPTION: BITLOCKER
19
Full disk encryption
▪ Entire disk is encrypted: protects all information
▪ Usually, user must provide password, key, or physical token at boot
time or to mount the disk; thereafter transparent encryption
▪ Software vs hardware based solutions:
– Security of entirely software-based products depends on the strength of
the password or key
– Tamper-proof hardware prevents brute-force cracking and allows
the use of a short PIN
▪ The main innovation in BitLocker was to use tamper-proof
hardware for unsupervised boot
20
Trusted platform module
▪ Trusted platform module (TPM) is a
smart-card-like tamperproof module on
the motherboard or integrated in the CPU
▪ Stores cryptographic keys
– Protects keys against both software and hardware attacks
– Key cannot be stolen, but can it be misused?
OS loader OS
S-CRTF UEFI e.g. Windows Boot
Manager (Windows)
23
Sealing data with TPM
▪ TPM operations:
– Sealing (TMP2_Create): encrypt data in any platform configuration
– Unsealing (TPM2_Unseal): decrypt the data, but only if the platform
configuration has not changed from the time of sealing
24
Windows BitLocker
▪ Principle: Encrypt drive with symmetric encryption. Seal the
symmetric encryption key with TPM and store the sealed key on
the disk. Unseal the key when booting
– TPM detects tampering of system software and prevents booting by
refusing to unseal the key
▪ Design goals:
– Laptop thief has to attack the TPM hardware
– Computer and hard drive decommissioning by resetting the TPM
– Windows user login and access control cannot be bypassed
by moving disk to another computer or booting from USB
– Dual boot allowed, but Linux cannot access the data
25
Extra
Which PCR values does BitLocker use for sealing? material
▪ If any of the *-marked values has changed, the decryption key will not be
unlocked and a recovery password is needed
▪ BitLocker keys will be unlocked before OS upgrade
Encrypted 100+ MB
Windows Boot partition
partition
BitLocker key hierarchy
▪ Network unlock
– Unsupervised reboot for servers in the same network with AD
▪ Others: USB stick with key file, USB stick + PIN, password only
[Photo: Microsoft] 30
BITLOCKER ANALYSIS
31
Secure path issues
▪ Hacked hardware can intercept PIN input to TPM
– Hardware key logger, modified keyboard, modified BIOS
– Attacker must have access to the computer twice: first to install the
hardware, then to recover the captured PIN/key
→ Lost and stolen computers are safe
▪ Malware could fake the reboot process and ask for the PIN
– Could also steal BitLocker keys from a USB stick
32
DMA attack
▪ Direct memory access (DMA) enables auxiliary devices to access
main memory directly
– FireWire, PCIe (also Thunderbolt, M.2, ExpressCard) busses
– Hot-pluggable helps attacker
35
Cold boot attack: consequences !
▪ Attacker with physical access to a running computer
– can break software-based full-disk encryption
– can bypass most OS access controls
▪ Sleeping laptop = running laptop
– Lost and stolen laptops are vulnerable if in sleep mode
▪ BitLocker in TPM-only mode is vulnerable even if
powered down or hibernating
– Attacker can boot it up and then do the
cold-boot attack
36
Mitigation of cold-boot attacks (1)
Best protection: never given attacker access to a running computer
▪ Disable sleep on the computer, shut down or hibernate instead
▪ Do not leave computer running unsupervised
▪ Set BitLocker to a supervised boot mode (TPM+PIN, TPM+USB)
Weaker protection:
▪ Password-protect BIOS or UEFI and disable USB boot
▪ BitLocker network unlock for non-mobile domain
computers
▪ UEFI secure boot: only allow certified OS loaders
37
Mitigation of cold-boot attacks (2)
OS and hardware solutions:
▪ Overwrite memory before reboot (easy to circumvent)
▪ Memory Overwrite Request Control (MOR): UEFI cleans the
memory after reboot
▪ Encrypted main memory in Xbox
▪ Self-encrypting drive: encryption on the disk drive itself;
keys are only briefly in main memory
38
Self-encrypting drive Performance: offload the
Encryption built into disk hardware/firmware data encryption and
decryption (AES) to
Obtain the Authentication
hardware on the drive
Key e.g. unseal with TPM
1
Security: mitigates cold-
boot and DMA
Authentication Key:
sent to the drive, decrypts
vulnerabilities because
Encrypted DEK 2 the Data Encryption Key keys are only briefly on
on the drive the main memory during
3 Data Encryption Key (DEK)
boot
never leaves the drive
4
Encrypted d70f3 and Plaintext Attacker could capture
bring
data 619a2 data
09b15 milk … keys on the PCIe/SATA/
SCSI bus during transfer
→Excellent idea to backup new and old EFS certificates and private keys!
Data recovery in EFS: domain
▪ Windows domain has a data recovery agent (DRA)
– FEK is encrypted also with the DRA public key
– Domain Administarator is the default DRA
– Other DRAs can be defined in a Group Policy in the domain
▪ If uncertain, check on any EFS-encrypted file:
> cipher /c .\file.txt
44
Data recovery in EFS
• File encryption key (FEK) is encrypted with one or more recovery agents’ public keys
• The same mechanism for sharing encrypted files between users
45
Data recovery in EFS: non-domain
▪ Standalone machine has no default DRA Not for the
average user
– Possible to set up your own DRA (cipher.exe)
▪ User may backup their EFS certificate and private key Not for the
to a USB or cloud drive average user
▪ Latest Password Reset Disk recovers EFS private key Ok for all,
but requires
– Did you make one? user action
46
Need for data recovery: BitLocker
If the TPM fails to unseal keys, encrypted data will be lost
49
Summary
▪ It is a very good idea to encrypt stored data, and convenient
technical solutions exist
However:
▪ Backups the keys to paper or to an online service
▪ Check that you can find and download the recovery keys
▪ Otherwise, expect your data to be lost accidentally
– there will be no way to decrypt it!
50
List of key concepts
▪ File encryption, wiping data, data remanence
▪ EFS, transparent encryption , key hierarchy, hibernation file
▪ Full-drive encryption, BitLocker, TPM, sealing and unsealing,
trusted boot, PCR
▪ Secure path, DMA attack , unsupervised boot, cold-boot attack,
network unlock, self-encrypting drive
▪ Data recovery agent, recovery password, key backup
51
Exercises
▪ What secure methods are there for erasing magnetic hard drives and tapes, USB stick or solid-state drives (SSD),
and paper documents?
▪ How to delete a specific file from a computer securely without erasing the whole disk?
▪ What security properties does GPG file encryption or EFS provide that full-disk encryption does not?
▪ How vulnerable is EFS to password guessing?
▪ Why do EFS and BitLocker have a key hierarchy of so many levels? Are all the keys necessary?
▪ Compare the security of fully software-based full-disk encryption and the TPM approach against brute-force
password guessing.
▪ Explain the differences between running, sleeping, hibernating, and powered-down laptop computer under the
cold boot attack.
▪ In EFS, local Admin cannot read the users’ encrypted files without the user passwords; can the Admin get
around this?
▪ Windows 2000 had the local Administrator account as the default EFS DRA for non-domain machines. Why was
this not a good idea?
▪ Transparent operation (happens without the user or application even knowing) improves usability of data
encryption, but are there risks associated with the transparency?
▪ How would you design the encryption of files in cloud storage? Can the encryption support file sharing between
users? What would be the policy and mechanism for revoking access to shared data?
52
Related reading
▪ Online:
– Halderman et al., Lest We Remember: Cold Boot Attacks on
Encryption Keys.
http://citp.princeton.edu/memory/
53