A small family of pure-Go packages for reading and writing
full-disk-encryption containers. The fde dispatcher exposes a single
Device interface over three backends — luks (LUKS 1/2),
apfs (APFS FileVault 2) and clear (plaintext passthrough) —
and identifies the format from the on-disk header via Detect / fde.Auto.
No cgo, no C toolchain. Each backend implements key derivation and the
block cipher itself in Go: PBKDF2 with the standard hash specs, anti-forensic split/merge and
aes-xts-plain64 / aes-cbc-essiv:sha256 for LUKS; PBKDF2-SHA256, AES-KW
key-bag unwrapping and AES-XTS for APFS FileVault 2. Backends compose over any
io.ReaderAt + WriteAt + Closer, so an encrypted volume can
sit on top of another block device such as a QCOW2 image. Scope is deliberate — rarer LUKS
ciphers and hashes are documented as out of scope rather than silently unsupported.
Repositories
fde
dispatcher
Unified Device interface that dispatches over the LUKS, APFS and plaintext backends, with header auto-detection (Detect / Open with fde.Auto). Layers on any io.ReaderAt + WriteAt + Closer, so it composes over backends like QCOW2.
luks
LUKS 1/2
Read/write support for LUKS1 and LUKS2 containers: phdr and binary-superblock + JSON metadata parsing, PBKDF2 key derivation, anti-forensic split/merge, and the aes-xts-plain64 and aes-cbc-essiv:sha256 ciphers. Rarer ciphers (twofish/serpent) and hashes (sha3, blake2b) are out of scope.
apfs
FileVault 2
Read/write support for APFS FileVault 2: the PBKDF2-SHA256 KEK, AES-KW (RFC 3394) key-bag unwrapping of the volume key, and AES-XTS per-512-byte-sector block encryption.
clear
passthrough
A plaintext Device that forwards all I/O straight to the underlying file or block device with no encryption, satisfying the same interface as the luks and apfs backends so fde can treat plaintext devices uniformly.
Every module is pure Go with CGO_ENABLED=0 and no C toolchain.
LUKS and APFS support is checked against reference test vectors; clear is a plaintext
passthrough used as the uniform baseline backend. BSD-3-Clause throughout.