What it does
The engine library can encrypt log payloads with AES-256-GCM under per-segment subkeys and manage a key ring with online rotation, crash-safe rewrap and revocation with MAC'd evidence. The server never turns it on, so no user can reach it today.
How it works
Each version 4 segment draws a random 128-bit salt and derives its own subkey from the ring key with HKDF-SHA256, binding the key identifier. Records are encrypted under that subkey, so a nonce is never reused under one key even though the engine re-issues sequence numbers after a rewind. An earlier design derived the nonce from the sequence number alone, which allowed nonce reuse across a rewind; version 4 replaces it, and older segments stay readable.
A ring holds keys in the states active, retired for new writes but still readable, and revoked. Rotation makes new appends go to a fresh segment under the new key at once, with no rewrite. Rewrap re-encrypts sealed segments under the active key with a temporary file, an fsync and an atomic rename, keeping the old file until the rename completes. Revocation refuses unless an inventory of segment headers proves nothing live still needs the key, and then returns durable, MAC'd evidence. A failed write on an encrypted log moves to a fresh salt before a sequence number is reused.
The same machinery applies to the object-storage backend. A wrong or missing key is a hard error, never a truncation.
Where you reach it
- Library
EngineConfig::encrypt_at_rest(key); UniversalLog::{install_keyring, rotate_key, rewrap_below, revoke_key} (engine library, not wired to the server)
Limits
- The server and the command line never call the encryption setting, so log segments are written unencrypted. Use disk or volume encryption at the host level for encryption at rest today.
- Raft is written to refuse an encrypted log, because the Raft log keeps a plaintext copy of replicated records.
- There is no operator interface for rotation, rewrap or revocation.
Evidence
- TestsCovered in the engine repository by 11 key-rotation tests, 12 encrypted-domain reopen tests, 27 in-crate encrypted-log tests, 5 format-guard tests and 3 encryption tests
Test coverage is listed as present in the engine repository at this edition. This page does not report test results.
KynetraDB is in private preview
This is not available in the preview. Request a preview to discuss the current scope.