Encrypting File System

Also known as: EFS

On this page 7

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.

ComponentWhere it livesWhat it protects
File Encryption Key$EFS attribute, wrappedThe file data stream
EFS certificateUser certificate storePublic key that wraps the FEK
Private keyUser profile, protected by DPAPIUnwrapping the FEK at open time
Recovery agent keyRecovery agent certificateEmergency access to the FEK
DPAPI master keyUser profileThe private key, derived from logon secrets
Components of the EFS key hierarchy

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.

CommandPurposeTypical use
cipher /eEncrypts the specified folder or fileProtecting a project folder
cipher /dDecrypts the specified folder or fileRemoving protection before migration
cipher /rCreates a recovery agent key and certificatePreparing a recovery agent
cipher /xBacks up the EFS certificate and keyExporting to a PFX file
cipher /uUpdates FEKs to current user keysAfter certificate renewal
cipher /wWipes free space on a volumeRemoving plaintext remnants
Common cipher command operations

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.

FeatureScopeProtects againstKey binding
Encrypting File SystemFiles and foldersOther users and administratorsUser certificate
BitLockerWhole volumeOffline disk theftTPM, PIN or recovery key
NTFS compressionFiles and foldersNothing, saves space onlyNot applicable
NTFS permissionsFiles and foldersAccess through the running OSAccess control lists
EFS compared with related Windows features

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.

SymptomCauseFix
Access denied after reinstallPrivate key lost with old profileImport the backed-up PFX file
Files unreadable after password resetDPAPI chain brokenUse the recovery agent certificate
Copied file no longer encryptedTarget lacks NTFS or ReFS EFS supportUse BitLocker To Go or an archive
Plaintext found in free spaceTemporary files before encryptionRun cipher /w on the volume
Cannot encrypt system filesWindows blocks EFS on system foldersUse BitLocker for the OS volume
Typical EFS problems and fixes

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.