Core library

core is the shared heart of llaves — a Kotlin Multiplatform library that holds everything security-critical and non-visual. Every app is a thin UI layer over it, so the same code runs on every platform.

What it does

  • KDBX read and write. Full KDBX 4 (Argon2d/Argon2id and AES-KDF key derivation; AES-256, Twofish and ChaCha20 ciphers), plus read and upgrade of KDBX 3.1.
  • Crypto wrappers. Vetted primitives (Argon2, AES-GCM/CBC, ChaCha20, HMAC, secure random), never reimplemented.
  • Data model. Databases, groups and entries, with history, attachments, custom icons, tags, expiry and TOTP secrets.
  • Unlock and search. Master password and key-file unlock; fast search.
  • Password & passphrase generator. Configurable character sets and a word-list mode, using the platform’s secure random.
  • TOTP. RFC 6238 codes for entries that carry an OTP secret.
  • Merge engine. The conflict-aware KDBX merge that makes sync safe — see below.

The merge engine

The merge engine is the feature that keeps sync from corrupting your vault. It matches entries by UUID, resolves conflicts by last-modification time, and keeps the losing version in history so a change is never silently dropped. It propagates moves (including soft deletes to the recycle bin) and, in synchronize mode, deletions via tombstones.

One engine serves two entry points: the automatic on-save merge, and the user-initiated “merge/import another file”. Because it lives in core, every app and the server resolve conflicts identically.

Portability

core keeps all platform-specific work behind a small expect/actual boundary (crypto, secure random, file access, key storage). Today Android, desktop and the server all share one JVM implementation; iOS later adds a native one without touching the parser, model or merge logic.