Skip to content

Repository files navigation

LibreCrate — offline document vault

Get it on GitHub

Version 0.5.5 ·

Encrypted document vault for Android, Linux, macOS, and Windows — stores, views, organizes, and searches PDFs, EPUBs, PKPass files, comic archives (CBZ), images, and personal notes. All documents are encrypted at rest with optional password protection and zero network access.

Platforms

Platform UI Status
Android Jetpack Compose Stable
Desktop (Linux/macOS/Windows) Iced (Rust) Stable
CLI (Linux/macOS/Windows) Terminal with interactive REPL Stable
Android Kotlin → Rust bridge UniFFI Stable

Features

  • Six document types: PDF, EPUB, PKPass (Apple Wallet passes), CBZ comics, Images, and Markdown notes
  • Encryption at rest: AES-256-GCM per-file encryption; master key wrapped via Argon2id + AES-256 Key Wrap (RFC 3394)
  • Optional password: Even with the device unlocked, content can't be read without the password
  • No network: Zero internet permission — your documents never leave the device
  • Library view: Grid/list, type filter, favorites, sort options, and reading-progress indicators
  • Reading position: Remembers last page for PDFs and comics, last location for EPUBs; shows "Page X of Y" / "% read" on cards
  • Full-text search: FTS5 search across title, author, description, and extracted document text, with highlighted snippets
  • Import: Share intents (single or multiple) and SAF file picker (bulk import)
  • Backup: Single encrypted .librecrate-backup file via SAF, verified by your password
  • Cross-platform backup: Backups created on Android can be restored on desktop and vice versa
  • F-Droid only: No Google Play Services, Firebase, Crashlytics, or AdMob

Desktop GUI

  • Iced-based native UI with vault creation, unlock, document library, and settings
  • Multi-file import: Drag-and-drop or file picker for bulk document import
  • Collections & Tags: Organize documents into collections and tag them
  • Backup/Restore: Export and import encrypted backups from the GUI
  • Password change: Change vault password from the settings screen
  • Settings: Theme selection, vault info, and security options

CLI

  • Interactive REPL: Launch librecrate with no arguments for a persistent shell session — enter vault and password once, then run commands
  • One-shot mode: librecrate <command> <vault_dir> -p <password> for scripting and automation
  • Commands: init, import, list, open, delete, search, backup, restore
  • Readline support: Command history (up/down arrows), line editing, ctrl-c/ctrl-d
  • Tab completion: Command names auto-complete

Android Viewers

  • PDF (MuPDF): paginated scroll, pinch-to-zoom/pan, fit modes (width/page/actual), night mode, last-page memory
  • EPUB (Readium 2): reflowable reader, table of contents, reader settings (font family/size, line height, margins), reading progress, rename/favorite/delete
  • Comics (CBZ): thumbnail grid + full-page reader, zoom/pan, last-page memory
  • Apple Wallet pass (PKPass): pass fields, themed colors, logo/strip images, barcode display (ZXing)
  • Images: full-screen Coil viewer with zoom/pan and an info overlay
  • Notes: Markdown editor with live preview, formatting toolbar, word/character count, and debounced autosave

Built with

Library Purpose
Jetpack Compose Android UI framework
Iced Desktop GUI framework (Rust)
Clap CLI argument parsing
Rustyline Interactive REPL (line editing, history)
Coil Image loading (Android)
MuPDF PDF rendering
Readium EPUB reader toolkit
ZXing Barcode display
CommonMark Markdown parsing
Apache Commons Compress Comic archive (CBZ) extraction
Argon2id + AES-256-GCM (Rust) Encryption at rest
SQLCipher (Rust via rusqlite) Encrypted database
UniFFI Kotlin–Rust bridge

Security

Layer Mechanism
Key derivation Argon2id (19 MiB memory, 2 iterations, 2 parallelism)
Key wrapping AES-256 Key Wrap (RFC 3394)
File encryption AES-256-GCM (12-byte IV, 128-bit tag)
Password mode Master key wrapped with password-derived key; device key deleted
Device-key mode Master key wrapped with per-device AES key (no password)
Lock Clears in-memory master key when app is backgrounded; requires password re-entry
Backup Encrypted Zip bundle with wrapped master key + DB + files

Project Structure

librecrate/
├── vault-native/
│   ├── core/          vault-native: shared Rust library (crypto, DB, merge, backup)
│   ├── cli/           librecrate CLI (interactive REPL + one-shot commands)
│   └── gui/           librecrate-gui (Iced desktop application)
├── app/               Android application
├── gradle/            Gradle build scripts
└── fastlane/          F-Droid metadata and screenshots

Building

Android

git clone https://github.com/DavidNeurieder/librecrate
cd librecrate
./gradlew assembleDebug

APK at app/build/outputs/apk/debug/app-debug.apk.

Requires Android SDK 36 (compileSdk). Set ANDROID_HOME or create local.properties:

sdk.dir=/path/to/Android/Sdk

The Rust native library (vault-native) is auto-built by Gradle via UniFFI — no manual steps needed. Install the Rust toolchain if missing:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Desktop CLI and GUI

cd vault-native

# Build CLI
cargo build --release --package librecrate
# → target/release/librecrate

# Build GUI
cargo build --release --package librecrate-gui
# → target/release/librecrate-gui

Testing

Android

# Unit tests (JUnit 4 + MockK + Robolectric + Turbine)
./gradlew testDebugUnitTest

# Instrumented tests (AndroidJUnit4 + Compose Test)
./gradlew connectedDebugAndroidTest
  • 120+ unit tests
  • 47+ instrumented tests

Desktop (CLI + GUI + Core)

cd vault-native
cargo test --workspace
  • 226+ tests (CLI integration, GUI unit, core unit, e2e)

CLI Usage

# Launch interactive REPL
librecrate
# Vault: ~/my-vault
# Password: ********
# librecrate> list
# librecrate> import ~/file.pdf
# librecrate> search algorithm
# librecrate> backup -o ~/backup.librecrate-backup
# librecrate> quit

# One-shot mode (for scripts/automation)
librecrate init ~/my-vault -p "mypassword" --from ~/Documents
librecrate import ~/my-vault -p "mypassword" ~/file.pdf ~/file.epub
librecrate list ~/my-vault -p "mypassword"
librecrate search ~/my-vault -p "mypassword" "search term"
librecrate backup ~/my-vault -p "mypassword" -o ~/backup.librecrate-backup
librecrate restore ~/my-vault -p "mypassword" ~/backup.librecrate-backup

Known Limitations (current build)

  • No idle auto-lock — the vault locks only when the app is closed.
  • No in-document search — search covers the whole library, not find-within a PDF/EPUB.
  • Barcodes are display-only — passes show barcodes; there is no camera scanning.
  • FTS after merge restore — full-text search may not work immediately after restoring a backup via merge.

Screenshots

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5 Screenshot 6 Screenshot 7

AllowedAPKSigningKeys to verify Releases:

SHA-256: 11f860ee7ac19b8d992a52bf114a491f9b8b598091b7a5e94ce775b50e6e69fa

License

AGPL-3.0-only. See LICENSE for details.

About

Offline document vault. Keep PDFs, ebooks, pkpass files, comic archives, document images, and personal notes safe, viewable, organized, and searchable.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages