gocryptfs README

项目的 README,来自 github.com/rfjakob/gocryptfs。合并为一个 markdown 文件:README.md。

gocryptfs CI MIT License Go Report Card Latest release Homebrew version

An encrypted overlay filesystem written in Go. Official website: https://nuetzlich.net/gocryptfs (markdown source).

[!WARNING]
The website "gocryptfs.com" is not affiliated with the gocryptfs project!

Folders side-by-side animation

gocryptfs is built on top the excellent go-fuse FUSE library. This project was inspired by EncFS and strives to fix its security issues while providing good performance (benchmarks). For details on the security of gocryptfs see the Security design document.

All tags from v0.4 onward are signed by the gocryptfs signing key. Please check Signed Releases for details.

Current Status

gocryptfs has reached version 1.0 on July 17, 2016. It has gone through hours and hours of stress (fsstress, extractloop.bash) and correctness testing (xfstests). It is now considered ready for general consumption.

The old principle still applies: Important data should have a backup. Also, keep a copy of your master key (printed at init) in a safe place. This allows you to access the data even if the gocryptfs.conf config file is damaged or you lose the password.

The security of gocryptfs has been audited in March 3, 2017. The audit is available here (defuse.ca).

Platforms

Linux is gocryptfs' native platform.

Beta-quality macOS support is available, which means most things work fine but you may hit an occasional problem. Check out ticket #15 for the history of macOS support but please create a new ticket if you hit a problem.

For Windows, an independent C++ reimplementation can be found here: cppcryptfs

Standalone tools:

gocryptfs-inspect is Python tool that can decrypt files & file names without using FUSE.

gocryptfs-create-folder is a Python tool can encrypt a directory without using FUSE.

Installation

Precompiled binaries that work on all x86_64 Linux systems are available for download from the github releases page. The fuse package from your distribution must be installed for mounting to work.

gocryptfs is also available as a package in most distributions. Examples:

See the Quickstart page for more info.

Testing

gocryptfs comes with is own test suite that is constantly expanded as features are added. Run it using ./test.bash. It takes about 1 minute and requires FUSE as it mounts several test filesystems.

The stress_tests directory contains stress tests that run indefinitely.

In addition, I have ported xfstests to FUSE, the result is the fuse-xfstests project. gocryptfs passes the "generic" tests with one exception, results: XFSTESTS.md

A lot of work has gone into this. The testing has found bugs in gocryptfs as well as in the go-fuse library.

Compile

Install Go 1.13 or higher:

Then, download the source code and compile:

$ git clone https://github.com/rfjakob/gocryptfs.git
$ cd gocryptfs
$ ./build-without-openssl.bash

This will compile a static binary that uses the Go stdlib crypto backend.

If you want to use the OpenSSL crypto backend (faster on old CPUs lacking AES-NI), you have to install a few dependencies:

Then, run:

$ ./build.bash

Use

$ mkdir cipher plain
$ ./gocryptfs -init cipher
$ ./gocryptfs cipher plain

See the Quickstart page for more info.

The MANPAGE.md describes all available command-line options.

Use: Reverse Mode

$ mkdir cipher plain
$ ./gocryptfs -reverse -init plain
$ ./gocryptfs -reverse plain cipher

Graphical Interface

The SiriKali project supports gocryptfs and runs on Linux and OSX.

cppcryptfs on Windows provides its own GUI.

Stable CLI ABI

If you want to call gocryptfs from your app or script, see CLI_ABI.md for the official stable ABI. This ABI is regression-tested by the test suite.

Storage Overhead

file-format.md contains a more detailed description.

Performance

Since version 0.7.2, gocryptfs is as fast as EncFS in the default mode, and significantly faster than EncFS' "paranoia" mode that provides a security level comparable to gocryptfs.

On CPUs without AES-NI, gocryptfs uses OpenSSL through a thin wrapper called stupidgcm. This provides a 4x speedup compared to Go's builtin AES-GCM implementation. See CPU-Benchmarks for details, or run gocryptfs -speed to see the encryption performance of your CPU. Example for a CPU with AES-NI:

$ ./gocryptfs -speed
gocryptfs v2.2.0-beta1-5-g52b0444-dirty; go-fuse v2.1.1-0.20210825171523-3ab5d95a30ae; 2021-09-14 go1.17.1 linux/amd64
cpu: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz; with AES acceleration
AES-GCM-256-OpenSSL              862.79 MB/s
AES-GCM-256-Go                   997.71 MB/s    (selected in auto mode)
AES-SIV-512-Go                   159.58 MB/s
XChaCha20-Poly1305-OpenSSL   729.65 MB/s
XChaCha20-Poly1305-Go            843.97 MB/s    (selected in auto mode)

You can run ./benchmark.bash to run gocryptfs' canonical set of benchmarks that include streaming write, extracting a linux kernel tarball, recursively listing and finally deleting it. The output will look like this:

$ ./benchmark.bash
Testing gocryptfs at /tmp/benchmark.bash.xFD: gocryptfs v2.0; go-fuse v2.1.1-0.20210508151621-62c5aa1919a7; 2021-06-06 go1.16.5 linux/amd64
WRITE: 262144000 bytes (262 MB, 250 MiB) copied, 0,698174 s, 375 MB/s
READ:  262144000 bytes (262 MB, 250 MiB) copied, 0,268916 s, 975 MB/s
UNTAR: 8,970
MD5:   4,846
LS:    1,851
RM:    2,367

Changelog

v2.7.0, 2026-11-08

v2.6.1, 2025-08-10

v2.6.0, 2025-07-14

v2.5.4, 2025-04-13

v2.5.3, 2025-04-05

v2.5.2, 2025-03-19

v2.5.1, 2025-01-23

v2.5.0, 2025-01-18

v2.4.0, 2023-06-10

v2.3.2, 2023-04-29

v2.3.1, 2023-03-04

v2.3.0, 2022-10-21

v2.3, 2022-08-28

v2.2.1, 2021-10-20

v2.2.0, 2021-09-25

v2.1, 2021-08-18

v2.0.1, 2021-06-07

v2.0, 2021-06-05

v2.0-beta4, 2021-05-15

v2.0-beta3, 2021-04-24

v2.0-beta2, 2020-11-14

v2.0-beta1, 2020-10-15

v1.8.0, 2020-05-09

v1.7.1, 2019-10-06

v1.7, 2019-03-17

v1.6.1, 2018-12-12

v1.6, 2018-08-18

v1.5, 2018-06-12

v1.4.4, 2018-03-18

v1.4.3, 2018-01-21

v1.4.2, 2017-11-01

v1.4.1, 2017-08-21

v1.4, 2017-06-20

v1.3, 2017-04-29

v1.2.1, 2017-02-26

v1.2, 2016-12-04

v1.1.1, 2016-10-30

v1.1, 2016-10-19

v1.0, 2016-07-17

v0.12, 2016-06-19

v0.11, 2016-06-10

v0.10, 2016-05-30

v0.9, 2016-04-10

v0.8, 2016-01-23

v0.7.2, 2016-01-19

v0.7.1, 2016-01-09

v0.7, 2015-12-20

v0.6, 2015-12-08

v0.5.1, 2015-12-06

v0.5, 2015-12-04

v0.4, 2015-11-15

v0.3, 2015-11-01

v0.2, 2015-10-11

v0.1, 2015-10-07

gocryptfs (rfjakob/gocryptfs)

正在搜索数据库…

这是什么?gocryptfs 是一个用 Go 编写的加密叠加文件系统。它将加密后的文件存放在一个目录中,并通过 FUSE 让你挂载一个解密后的视图。这样,数据在磁盘上是加密的,挂载后又能像普通文件一样访问。
它是桌面应用,还是命令行文件系统驱动?它是一个基于 go-fuse FUSE 库构建的命令行工具:你在终端中运行它来创建和挂载加密目录,它不附带图形界面。
我该如何创建并挂载一个加密目录?创建一个 cipher(加密目录)和 plain(挂载点)目录,运行 'gocryptfs -init cipher' 进行初始化,然后运行 'gocryptfs cipher plain' 挂载;放入 'plain' 中的文件会被透明地加密并存入 'cipher'。
使用前需要先安装什么?挂载功能需要你的 Linux 发行版中的 fuse 软件包才能正常工作;提供预编译的 x86_64 Linux 二进制文件,并且也已打包用于 Debian、Ubuntu、Arch 和 MacPorts。
它在 macOS 和 Windows 上的表现是否一样?Linux 是原生且完全支持的平台;macOS 支持仅为测试版水平,可能会偶尔遇到问题。Windows 没有原生的 gocryptfs 二进制文件,只有一个独立的 C++ 重新实现版本,名为 cppcryptfs。
谁会用它?有没有图形界面的替代方案?主要是开发者以及注重隐私、希望对静态数据进行加密存储的 Linux/macOS 用户;如果想要图形界面,第三方项目 SiriKali 在 Linux 和 OSX 上支持 gocryptfs,而 cppcryptfs 在 Windows 上自带图形界面。
如果我丢失了密码或配置文件,会怎样?你应该将主密钥(初始化时打印出来的)妥善保存一份副本,因为即使 gocryptfs.conf 文件损坏或密码丢失,主密钥仍能让你访问数据。
gocryptfs 是如何进行安全验证的?它于 2017 年 3 月 3 日接受了一次独立的安全审计(由 defuse.ca 发布),此外还使用 fsstress 进行了大量压力测试,并使用 xfstests 进行了正确性测试。
为什么要创建 gocryptfs,而不直接使用 EncFS?它受到 EncFS 的启发,但设计上旨在修复 EncFS 已知的安全问题,同时达到或超过其性能;从 v0.7.2 版本起,它在默认模式下与 EncFS 速度相当,而在安全级别相近的情况下,比 EncFS 的 paranoia 模式快得多。
加密文件会带来多少存储开销?空文件占用 0 字节,非空文件会增加 18 字节的文件头,每个 4kB 数据块增加 32 字节的开销(16 字节的 nonce(随机数)加上 16 字节的认证标签)。
我能否使用反向模式,将现有的明文目录以加密形式展示出来?可以,反向模式允许你将一个已有的明文目录呈现为加密视图,先用 'gocryptfs -reverse -init plain' 创建,再用 'gocryptfs -reverse plain cipher' 挂载。
有哪些类似的项目?turbocrypt, ente, kubo, rclone, greenbubbles, restic, cryptomator, borg
作者
rfjakob
大小
5.8 MB
星标
4.8K
时长
11年
提交 · 90 天