Device encryption and data erasure¶
Whether someone who gets hold of your laptop or phone, whether a thief, roommate, coworker, family member, or police officer, can read what is on it depends on full-disk encryption. With it on, the whole drive stays encrypted until you log in, and pulling the drive out and putting it in another computer does not help1.
Encryption also matters for deletion. Emptying the trash leaves files on the disk, and on the solid-state drives (SSDs) in modern computers and phones, overwriting a single file reliably is close to impossible. For an SSD, encrypting first and then resetting the device is the practical way to delete2.
This page combines and adapts two EFF Surveillance Self-Defense guides, How to: Encrypt Your Windows, Mac, or Linux Computer and How to: Delete Your Computer's Data Securely, adds phones, and updates the steps against vendor documentation. Changes are listed under Sources and review.
Short on time? Start here
- A phone with a passcode (iPhone) or screen lock (Android) is already encrypted, so make the passcode long
- On a computer, check that Windows Device encryption or BitLocker, or FileVault on a Mac, is on
- A recovery key stored in your Microsoft or Apple account is harder to lose, but the company then holds a key to your data
- Before selling or giving away a device, make sure it is encrypted, then use the system's reset
What full-disk encryption protects against¶
It protects a device that is off or locked. Once you are logged in, the data is decrypted, so encryption does not help if the device is taken while unlocked or you are made to unlock it1. Being asked to unlock at a border is covered in device minimization and border crossings in Asia.
Where to keep the recovery key¶
Turning on encryption creates a recovery key for when you forget your password. Lose both and the data is likely gone for good1.
- In your Microsoft or Apple account: you can unlock with your account and the company can help you regain access. The trade-off is that the company holds a key it could be legally required to hand to law enforcement, though it still protects you against thieves and others1
- Kept yourself: the company has no copy, and if you lose it there is no recovery. Anyone who finds it can unlock your computer. Keep a printout in a fireproof safe or with a trusted person elsewhere, or a digital copy in a password manager whose login differs from your computer's, never on the same computer or your usual cloud storage1
Turning it on¶
Windows calls it Device encryption or BitLocker drive encryption. Device encryption works on Windows Home if the hardware supports it, and turns on automatically when you first sign in with a Microsoft account or a work or school account, with the recovery key attached to that account. It does not turn on automatically with a local account3. Check under Settings > Privacy & security > Device encryption, signed in as an administrator. If it does not appear, the hardware may not support it3.
BitLocker, in Pro, Enterprise, and Education, lets you save the recovery key to your Microsoft account, a file, or a printout1. Keys saved to your account are listed at account.microsoft.com/devices/recoverykey4. If you have Windows Home on hardware without Device encryption, EFF suggests VeraCrypt instead1.
Macs with Apple silicon or a T2 chip encrypt data automatically. Turning on FileVault adds the requirement of your login password, and on other Macs it is what encrypts the data6. Go to Apple menu > System Settings > Privacy & Security > FileVault, turn it on, then choose "Allow my iCloud account to unlock my disk" or "Create a recovery key and do not use my iCloud account". If you choose the recovery key, write it down and keep it away from the Mac6.
Most distributions, including Ubuntu, Fedora, and Arch Linux, can only set up full-disk encryption (usually LUKS) during installation. If you skipped it, you will generally need to back up, wipe the drive, and reinstall. In the Ubuntu installer, choose LVM with encryption, set an encryption password, and optionally create a recovery key. You will then enter that password at every boot, separate from your login password1.
Setting a passcode turns on Data Protection, which encrypts the iPhone with 256-bit AES7. Under Settings > Face ID & Passcode (or Touch ID & Passcode), Passcode Options lets you switch to a longer alphanumeric code.
New devices launching with Android 10 or later use file-based encryption10. Its protection depends on the screen lock: without a PIN, pattern, or password, anyone holding the phone can read it. See phone privacy settings.
Why deleted files are not gone¶
Emptying the trash only hides a file and marks its space as reusable, which may not happen for months. Until then, recovery software or forensic tools can bring it back. A spinning hard drive can be overwritten, but SSDs, USB drives, and SD cards use wear leveling: the drive writes changes to new blocks and leaves old ones marked invalid, so overwriting a file does not guarantee the original block is erased. Most computers bought after about 2015 have an SSD. On these drives, encryption is more reliable than deletion2.
Before selling, giving away, or discarding¶
- Computer with an SSD: make sure it is encrypted, then reset it2
- Computer with a spinning hard drive: overwrite the whole drive first. If it was always encrypted, destroying the key is much faster2
- iPhone: sign out of your Apple Account, then Settings > General > Transfer or Reset iPhone > Erase All Content and Settings9
- Android: note the Google Account and password on the phone, then factory reset. Menu locations vary by brand11
- CDs and DVDs: shred them, or break them into small pieces2
On a spinning hard drive, the open-source BleachBit can securely delete individual files on Windows and Linux, clear traces left by specific programs (preview before deleting), and wipe free space. It gives no guarantee on SSDs, and macOS dropped secure deletion long ago, so rely on FileVault there2.
None of this removes copies elsewhere: backups, other drives, email servers, the cloud, or copies sent to others. File names can also linger in recent-documents lists and shell histories. The only way to be certain is to overwrite the whole disk and reinstall the operating system2.
Sources and review¶
Adapted from two guides in EFF's Surveillance Self-Defense, both licensed under CC BY 4.0: How to: Encrypt Your Windows, Mac, or Linux Computer (last reviewed 2025-02-06) and How to: Delete Your Computer's Data Securely (last reviewed 2025-05-08). We added phones and reset steps for selling a device, updated how Windows Device encryption behaves (on automatically with a Microsoft account, recovery key stored in the account), and left out the step-by-step BleachBit installation. Steps were checked in November 2026 against Microsoft Support, Apple's user guides and support articles, Android Help, and the Android Open Source Project. This page has not been reviewed by EFF, and anoni.net is responsible for any differences from the original.
Where to go from here¶
- What an ordinary person should actually do: where disk encryption fits in everyday preparation
- Device minimization and border crossings in Asia: what encryption cannot do when you are asked to unlock
- What is age: encrypting a single file
-
How to: Encrypt Your Windows, Mac, or Linux Computer - EFF Surveillance Self-Defense, last reviewed 2025-02-06. ↩↩↩↩↩↩↩↩
-
How to: Delete Your Computer's Data Securely - EFF Surveillance Self-Defense, last reviewed 2025-05-08. ↩↩↩↩↩↩↩
-
Device Encryption in Windows - Microsoft Support. ↩↩
-
Find your BitLocker recovery key - Microsoft Support. ↩
-
Reset your PC - Microsoft Support. ↩
-
Protect data on your Mac with FileVault - Mac User Guide. ↩↩
-
Set a passcode on iPhone - iPhone User Guide. ↩
-
Erase your Mac and reset it to factory settings - Apple Support. ↩
-
What to do before you sell, give away, or trade in your iPhone or iPad - Apple Support. ↩
-
Encryption - Android Open Source Project. ↩
-
Reset your Android device to factory settings - Android Help. ↩