Encrypting File System (EFS) is a feature of NTFS in Windows that encrypts individual files and folders transparently, so that only the user who encrypted them, or an authorized recovery agent, can read their contents. Among Windows storage & file systems features, EFS works at the file level and is bound to a user account and its certificate, which distinguishes it from full-volume protection such as BitLocker.
EFS first appeared in Windows 2000 and remains available in the Pro, Enterprise and Education editions. Home editions can open files they are authorized for but cannot encrypt new ones. Because encryption and decryption happen inside the file system driver, applications read and write protected files without any change in behavior.
How EFS encrypts and decrypts files
EFS uses a hybrid encryption scheme that combines fast symmetric encryption for file data with public-key cryptography for key protection. Each encrypted file receives its own random File Encryption Key (FEK), and the bulk data is encrypted with that key using AES with a 256-bit key on current Windows versions.
The FEK itself is then encrypted with the public key of the user’s EFS certificate and stored in a special NTFS attribute called $EFS, together with additional copies wrapped for each Data Recovery Agent and each user who has been granted shared access. When the file is opened, the user’s private key decrypts the FEK, and the FEK decrypts the data stream on the fly.
The following table lists the cryptographic components and the role each one plays in protecting a file.
| Component | Where it lives | What it protects |
|---|---|---|
| File Encryption Key | $EFS attribute, wrapped | The file data stream |
| EFS certificate | User certificate store | Public key that wraps the FEK |
| Private key | User profile, protected by DPAPI | Unwrapping the FEK at open time |
| Recovery agent key | Recovery agent certificate | Emergency access to the FEK |
| DPAPI master key | User profile | The private key, derived from logon secrets |
The private key is protected by the Data Protection API (DPAPI), which derives its master key from the user’s logon credentials. This chain explains a critical property: whoever can sign in as that user can read the files, and an administrator who resets the password without the old one can break the chain and lose access permanently.
Encrypting files and managing certificates
A user enables EFS through the Advanced Attributes dialog of a file or folder, or with the cipher command. Encrypting a folder sets an inheritance flag, so every new file created inside it is encrypted automatically, which is the recommended practice instead of encrypting files one by one.
The table below summarizes the most useful cipher operations for administrators working with EFS on Windows.
| Command | Purpose | Typical use |
|---|---|---|
cipher /e | Encrypts the specified folder or file | Protecting a project folder |
cipher /d | Decrypts the specified folder or file | Removing protection before migration |
cipher /r | Creates a recovery agent key and certificate | Preparing a recovery agent |
cipher /x | Backs up the EFS certificate and key | Exporting to a PFX file |
cipher /u | Updates FEKs to current user keys | After certificate renewal |
cipher /w | Wipes free space on a volume | Removing plaintext remnants |
On a standalone computer, Windows creates a self-signed EFS certificate the first time a user encrypts something. In a domain, a certificate authority can issue EFS certificates through Active Directory Certificate Services, and Group Policy can define recovery agents centrally. Backing up the certificate and private key to a password-protected PFX file is the single most important step after enabling EFS.
EFS compared with BitLocker and NTFS compression
EFS and BitLocker solve different threat models and are often used together. BitLocker encrypts the entire volume and protects data when a device is lost or its disk is removed, while EFS separates files between users of the same running system.
| Feature | Scope | Protects against | Key binding |
|---|---|---|---|
| Encrypting File System | Files and folders | Other users and administrators | User certificate |
| BitLocker | Whole volume | Offline disk theft | TPM, PIN or recovery key |
| NTFS compression | Files and folders | Nothing, saves space only | Not applicable |
| NTFS permissions | Files and folders | Access through the running OS | Access control lists |
NTFS stores encryption and compression as mutually exclusive attributes: a file can be compressed or encrypted, but not both. ACLs alone fail once someone boots another operating system or attaches the disk elsewhere, while EFS keeps the content unreadable without the matching private key.
Recovery agents and shared access
A Data Recovery Agent (DRA) is an account whose certificate is added to every newly encrypted file, giving the organization a way to decrypt data when a user leaves or loses a key. In domain environments, the domain administrator of the first domain controller is the default recovery agent, and many organizations replace it with a dedicated, offline-stored recovery certificate.
EFS also supports sharing an encrypted file with additional users by adding their certificates through the Details button in Advanced Attributes. Each added user receives an additional wrapped copy of the FEK. Sharing works only for individual files, not for whole folders, which limits EFS as a collaboration tool.
Limitations and common mistakes with EFS
EFS protection is lost silently in several everyday operations. Copying a file to FAT32, exFAT or most network shares and removable media decrypts it, often after a warning that users dismiss. Files sent by e-mail or uploaded to cloud storage leave the computer in plain form.
The next table connects frequent problems with their cause and the corrective action.
| Symptom | Cause | Fix |
|---|---|---|
| Access denied after reinstall | Private key lost with old profile | Import the backed-up PFX file |
| Files unreadable after password reset | DPAPI chain broken | Use the recovery agent certificate |
| Copied file no longer encrypted | Target lacks NTFS or ReFS EFS support | Use BitLocker To Go or an archive |
| Plaintext found in free space | Temporary files before encryption | Run cipher /w on the volume |
| Cannot encrypt system files | Windows blocks EFS on system folders | Use BitLocker for the OS volume |
Windows does not allow encrypting system files or the root of the system folder, and encrypting files used during startup would prevent the system from booting. Remnants of plaintext can also remain in the page file, hibernation file or temporary copies created by applications. For these reasons, EFS should complement, not replace, volume encryption.
The simple explanation
Encrypting File System is like a personal lock on selected files. Windows scrambles the content, and only your account holds the key that unscrambles it. Other people using the same computer, even administrators, see the files but cannot read them.
The key lives inside your user profile and is tied to your password. That is why backing up the key matters: if the profile disappears, the lock stays closed for good. EFS protects chosen files, while BitLocker protects the whole disk.
How it is used in practice
A small accounting office runs a shared Windows 11 Pro workstation that four employees use with separate accounts. Payroll spreadsheets must stay readable only by the payroll clerk, even though a colleague holds local administrator rights for maintenance.
The clerk creates a folder named Payroll, enables encryption on it, and every new spreadsheet saved there is encrypted automatically. The IT contractor exports the clerk’s EFS certificate to a password-protected PFX file kept in the office safe and configures a separate recovery agent certificate stored offline. BitLocker protects the whole system drive against theft.
Months later, the workstation is reinstalled after a disk failure. The clerk imports the PFX file, and the restored payroll files open normally. The outcome is separation between users and a tested recovery path, without any change to the spreadsheet application.