Transparent AES-128-CBC + HMAC-SHA256 encryption wrapper for microdb.
microdb_secure encrypts KV values, TS samples, and REL rows before they reach storage. Stored records use the layout [IV | tag | ciphertext].
- Encrypts all persisted payloads before they reach
microdb - Uses separate derived keys for encryption, MAC, and IV generation
- Detects tampering with truncated HMAC-SHA256 tags
- Keeps the implementation allocation-free in
src/
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build
ctest --test-dir build --output-on-failurecmake -B build
cmake --build build --config Debug
ctest --test-dir build -C Debug --output-on-failuresecure_kv: encrypted key-value operations, TTL, overwrite, tamper detectionsecure_ts: encrypted time-series registration, insert, query, tamper handlingsecure_rel: encrypted relational rows, shadow tables, iteration and deletessecure_integration: clean reinit, wrong-key detection, WAL recovery, multi-handle use,db_idvariations, and raw ciphertext checks
Current local suite count:
25KV tests20TS tests20REL tests16integration tests
Current local total: 81 tests.
The public entry points live in include/microdb_secure.h:
microdb_secure_init,microdb_secure_deinit,microdb_secure_rotate_keymicrodb_secure_kv_*microdb_secure_ts_*microdb_secure_table_*andmicrodb_secure_rel_*microdb_secure_store_db_id,microdb_secure_load_db_idmicrodb_secure_lock,microdb_secure_unlock
- CI is defined in
.github/workflows/ci.ymlfor Linux, Windows, and macOS. - Tagged pushes like
v1.0.0trigger.github/workflows/release.yml, which rebuilds, retests, packages static libraries, and publishes a GitHub Release with per-platform zip assets. - Wiki sync is defined in
.github/workflows/wiki.yml; after GitHub Wiki is enabled in repository settings, pushes tomaster/mainpublishdocs/wiki/automatically.