Optional encryption and framing applied after integrity repair and before wire send. Pure Rust (ChaCha20 RFC 8439, optional Poly1305, TLS record framing) — no external crypto libraries.

Module

src/plugin/encryptor.rs + src/plugin/crypto.rs. Default encryptor is null.

CLI / env

nexsiz -m http -e null -v
nexsiz -m http -e xor -k secret -v
nexsiz -m http -e chacha20 -k 0x0123... -v
nexsiz -m http -e chacha20+tls -v
export NEXSIZ_ENC_KEY='0x...'
export NEXSIZ_ENC_NONCE='0x...'
export NEXSIZ_NONCE_MODE=fixed   # or incrementing | random

Flags: -e / --enc / --encryptor, -k / --key. Config: encryptor, enc_key.

Implementations

NameAliasesRole
nullnoneIdentity
xorRolling XOR; skips protected fields
chacha20chachaRFC 8439 stream; counter reset per message by default
chacha20-poly1305aead, chacha-polyAEAD; output ciphertext ‖ 16-byte tag
tls-recordtlsTLS record framing (type/ver/len/payload); fragment >16 KiB
tls-handshake / tls-alertContent-type variants
chacha20+tlschacha+tlsStream encrypt then TLS frame
chacha20-poly1305+tlsaead+tlsAEAD then TLS frame
xor+tlsxor+tls-recordXOR then TLS frame

Nonce modes

  • fixed — deterministic (default; reproducible campaigns)
  • incrementing — monotonic per message
  • random — high-entropy per message

Key/nonce: hex (0x…) or raw string via CLI or NEXSIZ_ENC_KEY / NEXSIZ_ENC_NONCE.

Operational note

Prefer env for long-lived keys. Encryptor is for protocol-realistic wire shape and opaque channels during authorised testing — not a general-purpose crypto product API.