go-encryptions

Pure-Go encryption primitives โ€” the AEAD modes and disk-encryption crypto the standard library leaves out, with no cgo and no golang.org/x/crypto dependency.

CGO_ENABLED=0 stdlib crypto only no x/crypto standard cipher.AEAD interfaces BSD-3-Clause
Documentation GitHub

A small family of pure-Go encryption building blocks that sit just below application code: cipher modes and key-derivation paths that the Go standard library does not ship, exposed through the same crypto/cipher interfaces you already use. The first piece, ccm, supplies the AES-CCM AEAD that crypto/cipher omits; the second, zfscrypt, builds on it to decrypt OpenZFS native-encrypted datasets.

Pure Go, no cgo. Everything compiles and runs anywhere Go does, using only crypto/aes, crypto/cipher and the rest of the standard crypto tree โ€” no C bindings, no third-party crypto dependency. Implementations follow their reference specifications (RFC 3610 / NIST SP 800-38C for CCM; the OpenZFS on-disk crypto layout for zfscrypt) and ship with Go test suites.

Repositories

ccm libaead

AES-CCM AEAD (NewCCM / Seal / Open)

Pure-Go CCM (Counter with CBC-MAC) per RFC 3610 and NIST SP 800-38C โ€” the AEAD mode the standard library's crypto/cipher does not provide (it only ships GCM). Wraps any 128-bit cipher.Block as a standard cipher.AEAD, with configurable tag (4..16) and nonce (7..13) sizes. No cgo, no golang.org/x/crypto.

zfscrypt libdisk

OpenZFS native-encryption crypto (read path)

Pure-Go implementation of the cryptographic half of OpenZFS dataset-level (native) encryption: PBKDF2 wrapping-key derivation, master-key unwrap, HKDF-SHA512 per-block key derivation, and AES-CCM/GCM block decryption. Covers AES-128/192/256 in CCM (via ccm) and GCM (stdlib). Read path only today โ€” enough to pull files out of an encrypted root.

Every module is pure Go with CGO_ENABLED=0 and depends only on the standard crypto packages (no golang.org/x/crypto). Algorithms follow their reference specifications and expose the idiomatic cipher.AEAD / hash interfaces so they drop into existing code. BSD-3-Clause throughout.