Skip to content

DOCS / CONFIGURATION

Configuration

Config file

enprot reads a TOML config file from .enprot/config.toml in the current directory or any parent:

# .enprot/config.toml
[defaults]
cipher = "aes-256-siv"
pbkdf = "argon2id"

[argon2id]
t = 3           # iterations
m = 65536       # memory (KiB)
p = 1           # parallelism

[cas]
dir = ".cas"    # CAS directory relative to project root

[separators]
left = '// <('   # must be quoted — contains special chars
right = ')>'

[policy]
type = "default" # default, nist, or fips

Crypto policies

Policies gate every crypto operation. They check hash algorithms, PBKDF parameters, and cipher modes against an allowlist.

PolicyHashPBKDFAEAD
defaultAnyAnyAny
nistSHA-2, SHA-3PBKDF2, ScryptAES-GCM, AES-SIV
fipsSHA-2, SHA-3PBKDF2 onlyAES-GCM only

Force FIPS mode with --fips or the ENPROT_FIPS=1 env var. On Linux, FIPS auto-engages from /proc/sys/crypto/fips_enabled.

Environment variables

VariableDescription
ENPROT_CONFIGPath to config file (overrides auto-discovery)
ENPROT_CAS_DIRCAS directory
ENPROT_FIPSForce FIPS mode (1/0)
RUST_BACKTRACESet to full for backtraces

Config validation

enprot validates the config at startup. Invalid values (unknown ciphers, too-weak PBKDF params, etc.) produce a clear error with the offending field and expected range.