大网数据广告活动
磁盘与文件系统

File Encryption

· 52CE 我爱测

The Encrypted File System (EFS) provides cryptographic protection of individual files on NTFS file system volumes by using a public-key system.

The Encrypted File System (EFS) provides an additional level of security for files and directories. It provides cryptographic protection of individual files on NTFS file system volumes using a public-key system.

Typically, the access control to file and directory objects provided by the Windows security model is sufficient to protect unauthorized access to sensitive information. However, if a laptop that contains sensitive data is lost or stolen, the security protection of that data may be compromised. Encrypting the files increases security.

Working with EFS

To determine whether a file system supports file encryption for files and directories, call the GetVolumeInformation function and examine the FS_FILE_ENCRYPTION bit flag. Note that the following items cannot be encrypted:

  • Compressed files
  • System files
  • System directories
  • Root directories
  • Transactions

Sparse files can be encrypted.

TxF does not support most operations on Encrypted File System (EFS) files. The only operations TxF supports are read operations, such as ReadEncryptedFileRaw.

Note: When the source file is encrypted, CopyFile and CopyFileEx rely on the EFS service (hosted in lsass.exe) to create the target file and apply keys used in encryption of the source file. These operations are performed by EFS service while impersonating the caller of CopyFile or CopyFileEx.

In this section

The following topics provide information about file encryption:

Topic Description
Handling Encrypted Files and Directories A file marked encrypted is encrypted by the NTFS file system by using the current encryption driver.
Encrypted Files and User Keys Lists the functions to use to create a new key, add a key to an encrypted file, query the keys for an encrypted file, and remove keys from an encrypted file.
Backup and Restore of Encrypted Files The raw encryption functions enable backup of encrypted files.

For more information about encryption, see Adding Users to an Encrypted File.

For more information about cryptography, see Cryptography.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 07/08/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。