mimidesunya/encfsy
GitHub: mimidesunya/encfsy
encfsy 是一个基于 Dokany 和 Crypto++ 的 EncFS Windows 实现,通过透明加密文件名与文件内容,让用户安全地将加密数据同步到云端。
Stars: 25 | Forks: 5
# encfsy
🌐 **语言**:[English](README.md) | [日本語](README.ja.md) | [한국어](README.ko.md) | [简体中文](README.zh-CN.md) | [繁體中文](README.zh-TW.md) | [Русский](README.ru.md) | [العربية](README.ar.md) | [Deutsch](README.de.md)
## 关于 encfsy
encfsy 是由 **Dokany** 和 **Crypto++** 驱动的 EncFS Windows 实现。
它**仅在 64 位系统上运行**。
该程序会对文件名和文件内容进行加密,同时保持目录树结构不变。
这使得它非常适合与 Dropbox、Google Drive、rsync 或其他远程存储同步加密数据:文件始终保持端到端加密,因此存储管理员无法查看其内容。
## 支持的语言
encfsy 控制台应用程序会自动检测您的系统语言,并以相应的语言显示消息。
| 语言 | 代码 | 自动检测 |
|----------|------|-------------|
| English | `en` | 默认 |
| 日本語 (Japanese) | `ja` | Windows 日语 |
| 한국어 (Korean) | `ko` | Windows 韩语 |
| 简体中文 (Simplified Chinese) | `zh` | Windows 中文(中华人民共和国) |
| 繁體中文 (Traditional Chinese) | `zh-tw` | Windows 中文(台湾/香港) |
| Русский (Russian) | `ru` | Windows 俄语 |
| العربية (Arabic) | `ar` | Windows 阿拉伯语 |
| Deutsch (German) | `de` | Windows 德语 |
要手动覆盖语言,请使用 `--lang` 选项:
```
encfs.exe --lang ja # Japanese
encfs.exe --lang zh-tw # Traditional Chinese
encfs.exe --lang ru # Russian
```
## ⚠️ 重要提示:双向云同步请避免使用 `--paranoia`
当启用 `--paranoia` 模式(外部 IV 链接)时,同步工具对文件名进行的任何更改都可能使文件内容变成**无法恢复的乱码**,即使您手动将文件名改回原样也无济于事。
- 对于双向云同步(Dropbox/OneDrive/Google Drive 等),**请勿使用 `--paranoia`**。
- 如果必须使用,请将其限制在文件名永远不会更改的单向备份场景中。
## 云端冲突文件处理
在使用云存储服务(Dropbox、Google Drive、OneDrive)时,同步冲突可能会产生带有特殊后缀的文件,这些文件无法正常解密。`--cloud-conflict` 选项可以检测并处理这些冲突文件。
**支持的冲突模式:**
- Dropbox:`filename (Computer's conflicted copy 2024-01-01).ext`
- Google Drive:`filename_conf(1).ext`
**用法:**
```
encfs.exe C:\Data M: --cloud-conflict
```
**注意:** 此选项默认禁用,因为冲突检测可能会对性能产生轻微影响,并且仅在使用云同步服务时才需要。
## 扫描无效文件名
`--scan-invalid` 选项会扫描加密目录并报告任何无法解密的文件名。结果将以 JSON 格式输出。
**用法:**
```
encfs.exe C:\encrypted --scan-invalid
encfs.exe C:\encrypted --scan-invalid --cloud-conflict # With cloud conflict detection
```
**JSON 输出格式:**
```
{
"invalidFiles": [
{
"fileName": "encodedFilename",
"encodedParentPath": "encDir1\\encDir2",
"decodedParentPath": "dir1\\dir2"
}
],
"totalCount": 1
}
```
## 安全特性
encfsy 使用 **Windows 凭据管理器**进行安全的密码管理。
- 密码使用 **DPAPI**(数据保护 API)进行加密,并与当前用户账户绑定
- 免去了在 GUI 和 encfs.exe 之间通过 stdin 传递密码的需要,消除了拦截风险
- “记住密码”选项可保存密码,以便在下次启动时自动输入
- 密码**为每个加密目录 (rootDir) 分别存储**
### 密码存储位置
保存的密码可以在“控制面板” → “凭据管理器” → “Windows 凭据”中查看。
它们会以类似 `EncFSy:c:\path\to\encrypted` 的名称显示。
## GUI 用法
使用 **encfsw.exe** 可以在没有命令行的情况下轻松挂载和卸载卷。
1. 选择加密目录 (rootDir)
2. 选择要挂载的驱动器号
3. 输入您的密码(勾选“记住密码”以保存密码)
4. 点击“挂载”
“显示高级选项”提供了与命令行版本相同的详细设置访问权限。
“NameIO Stream”高级选项仅在创建新卷时选择 nameio/stream 文件名编码;现有卷将保留存储在 `.encfs6.xml` 中的设置。
## 从命令行使用凭据管理器
当您在 GUI 中勾选“记住密码”进行挂载时,密码会保存到 Windows 凭据管理器中。
然后,您可以使用 `--use-credential` 选项从命令行挂载,无需输入密码。
```
# 1. 首先,通过 GUI 挂载并勾选“Remember Password”
# → 密码将保存至 Credential Manager
# 2. 随后,从 command line 挂载,无需密码提示
encfs.exe C:\Data M: --use-credential
```
## 文件名长度限制
encfsy 使用现代的*长路径* API,因此传统的 260 字符 **MAX_PATH** 全路径限制**不**适用。
NTFS 仍然将每个路径组件(文件夹或文件名)的上限限制在 **255 个 UTF-16 字符**。
由于加密会使名称膨胀约 30 %,请**将每个文件名保持在 175 个字符以内**,以符合该组件限制,并与不支持长路径的工具保持兼容。
## 用法
```
Usage: encfs.exe [options]
Arguments:
rootDir (e.g., C:\test) Directory to be encrypted and mounted.
mountPoint (e.g., M: or C:\mount\dokan) Mount location - either a drive letter
such as M:\ or an empty NTFS folder.
Options:
-u Unmount the specified volume.
-l List currently mounted Dokan volumes.
-v Send debug output to an attached debugger.
-s Send debug output to stderr.
-i (default: 120000) Timeout (in milliseconds) before a running
operation is aborted and the volume unmounted.
--use-credential Read password from Windows Credential Manager
(password is kept stored).
Note: Password must be saved first via GUI
with "Remember Password" checked.
--use-credential-once Read password from Windows Credential Manager
and delete it after reading (one-time use).
--scan-invalid Scan encrypted directory for filenames that
cannot be decrypted. Output is in JSON format.
--dokan-debug Enable Dokan debug output.
--dokan-network UNC path for a network volume (e.g., \\host\myfs).
--dokan-removable Present the volume as removable media.
--dokan-write-protect Mount the filesystem read-only.
--dokan-mount-manager Register the volume with the Windows Mount Manager
(enables Recycle Bin support, etc.).
--dokan-current-session Make the volume visible only in the current session.
--dokan-filelock-user-mode Handle LockFile/UnlockFile in user mode; otherwise
Dokan manages them automatically.
--dokan-enable-unmount-network-drive Allow unmounting network drive via Explorer.
--dokan-dispatch-driver-logs Forward kernel driver logs to userland (slow).
--dokan-allow-ipc-batching Enable IPC batching for slow filesystems
(e.g., remote storage).
--public Impersonate the calling user when opening handles
in CreateFile. Requires administrator privileges.
--allocation-unit-size Allocation-unit size reported by the volume.
--sector-size Sector size reported by the volume.
--volume-name Volume name shown in Explorer (default: EncFS).
--volume-serial Volume serial number in hex (default: from underlying).
--paranoia Enable AES-256 encryption, renamed IVs, and external
IV chaining.
--alt-stream Enable NTFS alternate data streams.
--case-insensitive Perform case-insensitive filename matching.
--nameio-stream Use nameio/stream filename encoding when creating
a new volume (default: nameio/block).
--cloud-conflict Enable cloud conflict file handling (Dropbox,
Google Drive, OneDrive). Disabled by default.
--reverse Reverse mode: show plaintext rootDir as encrypted
at mountPoint.
Examples:
encfs.exe C:\Users M: # Mount C:\Users as drive M:\
encfs.exe C:\Users C:\mount\dokan # Mount C:\Users at NTFS folder C:\mount\dokan
encfs.exe C:\Users M: --dokan-network \\myfs\share # Mount as network drive with UNC \\myfs\share
encfs.exe C:\Data M: --volume-name "My Secure Drive" # Mount with custom volume name
encfs.exe C:\Data M: --use-credential # Use stored password from Credential Manager
encfs.exe C:\Data M: --nameio-stream # Create a new volume with nameio/stream
encfs.exe C:\Data M: --cloud-conflict # Mount with cloud conflict file support
encfs.exe C:\encrypted --scan-invalid # Scan for invalid filenames (JSON output)
To unmount, press Ctrl+C in this console or run:
encfs.exe -u
```
## 安装
1. 安装 **Dokany**(≥ 2.0)— 从[官方发布版](https://github.com/dokan-dev/dokany/releases)下载。
2. 从 [Releases 页面](https://github.com/mimidesunya/encfsy/releases)下载最新的 **encfsy 安装程序**,并按照设置向导进行操作。
## 许可证
[LGPL-3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html)
## 作者
[Mimi](https://github.com/mimidesunya) | [X @mimidesunya](https://twitter.com/mimidesunya)
标签:Crypto++, Dokany, EncFS, 数据加密, 文件系统, 跨平台