Lode

Deduplicating, self-healing, encrypted archives.

  • Linuxx86_64 · KDE Plasma desktop app + CLI
Download for Linuxlode-v0.4.1-x86_64-linux.tar.gz · 1.51 MB All 2 downloads & checksums
Version
v0.4.1
Updated
License
GPL-3.0
Built with
Rust
Downloads
4
Mirror

What it does

Lode is a single-file archive format that compresses smaller than 7-Zip, deduplicates like borg and restic, and repairs itself with RAR-style recovery records that are on by default. Authenticated encryption hides even the file names, and every byte of Linux metadata is preserved. Comes with a command-line tool and a KDE Plasma desktop app.

  • Context-mixing compressor that beats xz and 7-Zip
  • Content-defined deduplication across files and versions
  • Recovery records repair bit-rot and damaged sectors
  • Encrypted archives that hide file names too

Supported systems

  • Linuxx86_64 · KDE Plasma desktop app + CLI

Downloads v0.4.1

FilePlatformSizeSHA-256Download
lode-v0.4.1-x86_64-linux.tar.gzRelease · sha256 Linux x86_64 1.51 MB Get
Lode-v0.4.1-source.zipSource Any 884 KB Get
How to verify a download

Every file is hashed as it is mirrored. Drop a file you downloaded here and your browser checks it locally — nothing is uploaded.

Or compare the checksum with the one your system computes:

# Linux
sha256sum lode-v0.4.1-x86_64-linux.tar.gz
# macOS
shasum -a 256 lode-v0.4.1-x86_64-linux.tar.gz
# Windows (PowerShell)
Get-FileHash lode-v0.4.1-x86_64-linux.tar.gz -Algorithm SHA256

Changelog

  1. Regenerate the golden corpus (0.4.1 code) with files owned by root

    669cce2 ·
  2. Docs for 0.5.0: built to last, offline builds, own cryptography; release 0.5.0

    77bf2d4 ·
  3. FORMAT.md: complete specification of LCM, the filters and the recovery Reed-Solomon code; cite the standards used

    daf6fe3 ·
  4. Pin the Rust toolchain; offline source bundle with vendored crates; CI builds it offline and attaches it to releases

    071dc3e ·
  5. wip: toolchain and bundle script

    e537b5b ·
  6. Commit the golden .lode archives (were ignored); desktop app renders with OpenGL only (drop wgpu)

    a726810 ·
  7. Desktop app: own settings format, pre-rendered logo, PNG writer; drop resvg, egui_extras, serde, toml, libc, tempfile, zeroize and unused eframe features

    669ca6e ·
  8. CLI without dependencies: own argument parser, errors, password prompt and FUSE server (drop clap, anyhow, rpassword, libc, zeroize, fuser)

    cfa89ec ·
  9. Own zstd decoder and encoder (RFC 8878): lode-core now has no dependencies outside the Rust standard library

    764a264 ·
  10. Own Reed-Solomon (GF(2^16) additive FFT, identical to reed-solomon-simd 3.x output): drop reed-solomon-simd

    2a6c6e8 ·
  11. Own SHA-2, BLAKE2b, ChaCha20-Poly1305, Argon2id, X25519, AES, bcrypt_pbkdf, base64 and OpenSSH key reader: drop chacha20poly1305, argon2, x25519-dalek, curve255

    f4dad05 ·
  12. Own BLAKE3 (portable + AVX2, multi-threaded) replaces the blake3 crate

    1930a64 ·

Documentation

Lode icon: a layered archive block with a gold ore vein and a shard returning to its corner

Lode

Deduplicating, self-healing, encrypted archives for Linux.

One file. Every byte of metadata. Smaller than 7-Zip. Repairs itself.

Install · Desktop app · Quick start · Benchmarks · How it works · Format spec


Lode combines ideas that until now lived in separate tools into a single archive format: zstd's speed, a context-mixing compressor that beats xz and 7-Zip, content-defined deduplication like borg and restic, RAR-style recovery records (on by default), authenticated encryption that hides file names, and full Linux metadata. The archive understands the data it stores, assumes the disk will eventually fail, and assumes someone untrusted will eventually see the file.

$ lode c project.lode project/
Archived 10594 files, 2546 dirs: 174.6 MiB → 17.6 MiB (9.92:1)
  deduplicated 81.6 MiB · unchanged 0 B · new 93.0 MiB
  recovery data 685.4 KiB

$ lode t project.lode
Recovery data: OK (4471 shards checked)
Content: OK (15 records, 13140 entries, 93.0 MiB verified)

Highlights

🧠 Adaptive compression Every block is routed to the codec that works best for it: zstd with long-distance matching, the LCM context-mixing compressor for maximum ratio, branch-converting x86/ARM64 filters for executables, delta filters for raw tables and audio, and store for data that is already compressed. Decided by real trial compression, not guesswork.
♻️ Deduplication Content-defined chunking with BLAKE3 identifiers. Ten copies of a file, or this week's backup next to last week's, cost almost nothing.
🛟 Self-healing Interleaved Reed–Solomon recovery data (3 % by default) rebuilds damaged sectors, torn writes and bit rot in place with lode repair. Shard-level hashes find damage exactly.
🔐 Encryption XChaCha20-Poly1305 for every record, Argon2id for passwords, SSH ed25519 keys or X25519 public keys for write-only backup servers. File names, sizes and structure are encrypted too. Tampering is detected, never silently ignored.
🐧 Complete Linux metadata Permissions incl. setuid/sticky, owners (by name and id), nanosecond timestamps, symlinks, hard links, sparse files, device nodes, FIFOs, xattrs, POSIX ACLs, SELinux labels and file capabilities, by default.
🗂️ Generations & snapshots Append to an archive, or take incremental --snapshot backups. Unchanged files are not even re-read. Every earlier generation stays restorable.
📂 Mount it lode mount backup.lode ~/mnt: browse, grep and copy straight out of the archive with FUSE.
🩺 Survives the worst When damage exceeds the recovery data, lode salvage scans for self-describing records and rescues every intact file, even with the index, trailer and header destroyed.
🛡️ Safe by construction Written in Rust. Extraction uses openat(O_NOFOLLOW) path walking: no zip-slip, no symlink escapes. Hostile archives are fuzzed against: they produce errors, never crashes.
📖 Open format Fully specified in docs/FORMAT.md, so anyone can write a compatible reader.

Benchmarks

98 MiB corpus: Rust crate sources (5,300 files) plus six system binaries (git, python, perl, vim, gcc, ssh). 20-thread desktop CPU, warm cache. Lode archives include 3 % recovery data unless noted. Every result was extracted and verified byte-identical.

Tool Size Ratio Compress Extract
tar + zstd -3 19.90 MiB 4.93 : 1 0.14 s 0.11 s
tar + zstd -19 14.79 MiB 6.64 : 1 12.2 s 0.12 s
tar + xz -9 13.97 MiB 7.03 : 1 28.5 s 0.45 s
7z -mx9 13.07 MiB 7.51 : 1 16.7 s 0.53 s
lode --fast 19.97 MiB 4.92 : 1 0.20 s 0.14 s
lode (balanced, default) 17.43 MiB 5.63 : 1 0.70 s 0.16 s
lode --smallest 12.49 MiB 7.86 : 1 30 s 28 s
lode --smallest -r 0 (no recovery) 12.01 MiB 8.18 : 1 30 s 28 s
  • Default mode is 12 % smaller than zstd -3 at the same order of speed, while also deduplicating, verifying and carrying recovery data.
  • --smallest beats every other tool tested, even with its 3 % recovery data included: 4.5 % smaller than 7-Zip, 11 % smaller than xz, 16 % smaller than zstd -19. Without recovery data it is 8 % smaller than 7-Zip and 14 % smaller than xz. It uses context mixing, so extraction is as slow as compression. That is the trade-off this flag chooses; the default mode extracts at zstd speed.

Deduplication (two copies of the same corpus, 224 MiB):

Tool Size Time
tar + zstd -19 29.58 MiB 12.4 s
7z -mx9 13.78 MiB 40.0 s
lode (default) 17.58 MiB: the second copy costs 0.15 MiB 0.77 s

Incremental backup: after editing 20 source files, lode a --snapshot took 0.07 s and grew the archive by 380 KiB.

Reproduce with scripts/bench.sh on your own data.

Desktop app

Lode: Create archive page Lode: browsing an archive

A clean, modern desktop application for KDE Plasma (and other Linux desktops) with a dark and light theme that follows your system:

  • Create archives by dropping files on the window. Lode uses its Balanced compression for everything, choosing the best method for each kind of data automatically. You choose the recovery data and how it is locked: a password (with a strength meter), an SSH key, or both. Every new archive is read back from disk and verified before Lode reports success, so a failing drive is caught immediately. The result is short and clear: a green check, the size before and after side by side, and buttons to open the archive or show it in its folder.
  • Opens other archives too: zip, 7z, rar, tar (.gz, .xz, .zst, .bz2, …), single .gz/.xz/.zst files, ISO images, cpio, cab, deb, lha and more, through the system's libarchive (the same library KDE's Ark uses). Browse them, extract all or a selection, Test their checksums, and Convert to .lode to add recovery data, deduplication and verification. A converted password-protected archive keeps the same password. Extraction uses the same protections as .lode archives (no ../ or absolute paths, never writing through symlinks).
  • Lode's own file dialogs for adding files, saving and extracting, in the same look as the rest of the app, with your Desktop/Documents/Downloads folders and drives in the sidebar, and a New folder button when choosing where to extract or save.
  • Browse archives like folders, search them, open a file with a double-click, extract everything or just a selection, switch between saved versions, and Verify or Repair with one click.
  • Right-click menu in Dolphin. A Lode submenu offers Compress here (.lode), Compress with password… and Compress to… on any files, and Extract here, Extract to…, Open with Lode and Verify archive on .lode files, and Extract here, Extract to…, Open with Lode and Convert to .lode on zip, 7z, rar, tar and other archives. It works in Dolphin and on the desktop. These quick actions run in a small progress window. Extract here is smart: an archive with a single folder is extracted as that folder, anything else goes into a new folder named after the archive.
  • Private by design. With a password or key, file names, folders, sizes and dates are encrypted together with the contents: without it nobody can even see the list of files. Use Protect with password or SSH key when creating an archive, or Compress with password… in the right-click menu.
  • Lock with your SSH key. Paste an ssh-ed25519 public key, or load its .pub file from wherever you keep it, and choose SSH key or Both. Only the matching private key opens the archive, so there is no password to guess. When opening, you choose the private key file (Lode remembers where it is, never searches for keys and never copies them), and a key protected with a passphrase asks for that passphrase. With Both, either the password or the key opens it.
  • Opens where you work. New windows, including Open with Lode and the right-click progress windows, open on the screen where you last used Lode instead of the first monitor, and the main window remembers its size.
  • First-run setup wizard that explains what Lode does and lets you choose the recovery data and whether Lode is added to the app menu and the right-click menu. Everything can be changed later in Settings.
Lode: archive created and verified Lode: lock an archive with a password or an SSH key Setup wizard: welcome

Install

Kubuntu and other KDE Plasma systems (desktop app + command line)

git clone https://github.com/narl3yyy-svg/lode.git
cd lode
./install.sh

The installer checks for what Lode needs and offers to install anything that is missing: a C compiler (build-essential), Rust 1.95 or newer (for your user only, via the official rustup installer), and FUSE 3 for lode mount. It then builds Lode and installs it for your user only, no root needed:

What Where
lode (command line) and lode-gui (desktop app) ~/.local/bin
App menu entry, icon, .lode file type ~/.local/share
Right-click menu (only if you turn it on) ~/.local/share/kio/servicemenus
Settings ~/.config/lode

Start Lode from the application menu. The setup wizard opens the first time. Options: ./install.sh --yes (no questions), --context-menu (enable the right-click menu right away), --no-launch.

Try it without installing: ./run.sh builds Lode in this folder and starts it (with the setup wizard on first start). ./run.sh archive.lode opens an archive directly.

Uninstall: ./uninstall.sh removes the programs, the app menu entry, icons, file type, right-click menu, settings, caches and the build output, plus the dependencies that the installer installed for Lode. It records them in ~/.local/share/lode/install.manifest, so software you already had is never removed. Your .lode archives are never touched. Use --keep-deps to keep Rust and the system packages.

Command line only (any Linux)

cargo install --path crates/lode-cli          # Rust 1.85 or newer

This downloads nothing: the lode command and its library use only the Rust standard library. Every release also has a ready-made static binary that runs on any x86-64 Linux.

lode mount needs FUSE 3 (fusermount3, package fuse3). To build without it: cargo install --path crates/lode-cli --no-default-features.

What does "Recovery 3 %" mean?

Recovery data is extra information stored in the archive that lets Lode repair it if part of the file gets damaged later: bad sectors on a disk, a dying USB stick or SD card, or a copy that was interrupted. With 3 %, damage to up to about 3 % of the archive can be rebuilt with Repair; the archive is about 3 % bigger. More is safer but larger: 3 % suits everyday use, 5–10 % long-term storage, and more for unreliable media. With 0 %, damage is still detected by Verify but cannot be repaired. Small archives show a slightly higher value (for example 3.5 %) because some recovery data is always kept as a minimum.

Why is my archive about the same size as the original (or a little bigger)?

Photos, videos, music, game data and other archives (zip, 7z, …) are already compressed. No compressor can shrink them much: on such data zstd and xz save about 1 %. Lode notices this, stores the data as it is (only spending effort where it pays off), and adds the recovery data you chose. The archive is then about the original size plus that recovery data (3 % by default). Lode's result window shows the size before and after, so you can see it at a glance.

Lode and Ark

Lode can be your archive manager: choose it in System Settings › Default Applications › Archive manager, and archives open in Lode when double-clicked. The Compress submenu in the right-click menu belongs to Ark (it is part of the Ark package) and stays as long as Ark is installed. Lode adds its own Lode submenu next to it. To hide Ark's entries, uncheck them in Dolphin › Configure › Context Menu, or uninstall Ark.

Troubleshooting

  • Drag and drop / window icon on Wayland. The windowing library Lode uses supports dropping files and window icons only on X11, so on a Wayland session Lode runs through XWayland (built into KDE Plasma and GNOME). To force native Wayland anyway: LODE_WAYLAND=1 lode-gui.
  • The window does not open. Lode draws with OpenGL and falls back to software rendering automatically, for example when there is no working GPU driver. To force software rendering: LODE_RENDERER=software lode-gui.
  • The right-click menu does not show up. Make sure it is on in Lode › Settings, then restart Dolphin. The files are ~/.local/share/kio/servicemenus/lode-*.desktop.
  • lode is not found in a terminal. Log out and back in once after installing, so that ~/.local/bin is added to your PATH.

Quick start

# Create, list, extract
lode c project.lode ~/code/project
lode l -l project.lode
lode x project.lode -C ~/restore

# Encrypt with a password (file names are encrypted too)
lode c -e secrets.lode ~/Documents/taxes

# Encrypt to an SSH key; open with its private key (asks for its passphrase)
lode c -R ~/keys/laptop_ed25519.pub secrets.lode ~/Documents/taxes
lode x -i ~/keys/laptop_ed25519 secrets.lode -C ~/restore
lode c -e -R "ssh-ed25519 AAAA… friend@laptop" shared.lode ./photos   # password or key

# Maximum compression (slow, symmetric)
lode c --smallest dataset.lode ./corpus

# Verify everything: recovery data, checksums, decryption, every chunk
lode t backup.lode

# Repair damage in place, or rescue what is left of a wrecked archive
lode repair backup.lode
lode salvage backup.lode -C ./rescued

# Incremental backups: only changes are stored, all versions remain
lode c home.lode ~/
lode a --snapshot home.lode ~/        # tomorrow
lode l -g 1 home.lode                 # what it looked like on day one
lode x -g 1 home.lode -C /tmp/old

# Browse without extracting
lode mount home.lode ~/mnt            # Ctrl-C to unmount

# Write-only backups: the server can create archives but not read them
lode keygen -o ~/.lode/backup.key     # prints the public key
lode c -R lodepk1… nightly.lode /srv/data
lode x -i ~/.lode/backup.key nightly.lode -C /restore

# Streams
lode c - ./dir | ssh host 'cat > dir.lode'
lode cat archive.lode path/in/archive.txt | less

Run lode help <command> for all options.

Command Alias Purpose
create c Create an archive (- for stdout)
extract x Extract all or selected paths/globs
list l, ls List contents (-l for details, -g N for a generation)
append a Add a generation; --snapshot for backups
info i Statistics, codecs, encryption, generations, root hash
verify t Full integrity check (--physical for a keyless fast check)
repair Rebuild damaged data from the recovery records
salvage Rescue intact files from an archive beyond repair
protect Add or resize recovery data (e.g. after streaming)
cat Write one file to stdout
mount Read-only FUSE mount
keygen Create an X25519 key pair (or use an SSH ed25519 key)

How it works

files ─► scan ─► chunk ─► dedup ─► classify ─► group ─► filter+compress ─► encrypt ─► seal
        lstat   content   BLAKE3   magic,      per-     trial-selected     XChaCha20  Reed-Solomon
        xattrs  defined   ids      entropy     class    zstd / LCM /       Poly1305   recovery,
        ACLs    (gear)             ELF/PE      solid    x86 / delta /                 Merkle root
                                               blocks   store

1. Scan. Everything Linux cares about is recorded: see Highlights. Sparse files are read with SEEK_DATA/SEEK_HOLE and stored as holes, and source access times are left untouched where the kernel allows it (O_NOATIME).

2. Content-defined chunking. A gear rolling hash with FastCDC-style normalisation cuts data at content-dependent boundaries (256 KiB average). Inserting a line at the top of a file changes one chunk, not all of them. In encrypted archives the gear table is keyed, so chunk sizes reveal nothing about the plaintext.

3. Deduplication. Each chunk is identified by BLAKE3 (keyed in encrypted archives); a chunk already stored, in this generation or any earlier one, is referenced instead of stored.

4. Classification and grouping. Files are classified as text, binary, x86 or ARM64 code, or already compressed. Same-class data is packed into semi-solid blocks (8–32 MiB), sorted by extension. You get most of the gain of solid compression, but damage stays local and a single file can be read without decoding the whole archive.

5. Codec selection. Per block, by trial compression on samples (or, with --smallest, on the whole block):

Data Treatment
Already compressed (JPEG, video, zip...) detected and stored, no CPU wasted
Executables reversible x86 CALL/JMP or ARM64 BL address conversion, then compression
Raw tables, audio, images delta filter (stride chosen by trial)
Everything zstd with long-distance matching; with --smallest, also LCM

LCM (Lode Context Mixing) is Lode's own compressor for --smallest. Ten context models (orders 0–6, word, word bigram, column, sparse) and a match model each predict every bit. Each model slot keeps a fast and a slow probability estimator, and two gated logistic mixers learn online which predictions to trust. Two SSE stages refine the result and a binary arithmetic coder emits it. It's all integer arithmetic, so it is bit-exact on every machine.

6. Encryption. A random data key per archive, wrapped in password slots (Argon2id, 256 MiB) and/or X25519 public-key slots (Lode keys or SSH ed25519 keys). Every record is sealed with XChaCha20-Poly1305, bound to the archive id, its type, sequence number and length, so records cannot be modified, reordered, truncated or transplanted between archives without detection.

7. Seal. Each record carries a BLAKE3 hash; the index lists every record hash, and its own hash is the archive's root hash, printed by lode info, which you can publish or sign. The index, header and trailer are written so that a damaged or truncated archive can still be opened at its last consistent state or salvaged record by record. Finally, the whole archive is cut into shards, interleaved into stripes, and protected by Reed–Solomon parity (GF(2¹⁶), O(n log n)). Because stripes are interleaved, a contiguous burst of damage up to roughly the recovery percentage of the whole archive is repairable, while scattered damage is repairable as long as no stripe loses more shards than it has parity.

More detail: docs/DESIGN.md · normative spec: docs/FORMAT.md

Reliability and security

  • Crash-safe writes. New archives are written to a temporary file and renamed into place only when complete. Appends keep the previous version readable if interrupted.
  • End-to-end verification. Every chunk is verified against its BLAKE3 id on extraction. Corruption is reported, never silently written to disk.
  • Hostile input. All parsing is bounds-checked and allocation-limited (no decompression bombs, no unbounded KDF parameters). The test suite includes property tests for every codec and filter and randomised corruption of plain and encrypted archives.
  • Safe extraction. Absolute paths, .., NUL bytes and symlinked path components are refused; existing files are never overwritten unless you pass --overwrite.
  • Owners are restored when running as root (or with --same-owner), mapped by user and group name first, as with tar.

Found a security issue? Please see SECURITY.md.

Built to last

An archive is only useful if something can still open it in twenty years. Lode is built so that its source alone is enough:

  • No dependencies where it matters. The archive library and the lode command use nothing but the Rust standard library. Lode carries its own implementations, written from the published specifications and checked against their official test vectors, of:
    • zstd (RFC 8878) and BLAKE3;
    • XChaCha20-Poly1305, Argon2id and X25519;
    • the OpenSSH key format;
    • the Reed–Solomon recovery code.
  • A complete specification. docs/FORMAT.md describes every byte and every algorithm, including Lode's own context-mixing codec, so another program could read .lode files from the document alone.
  • Old archives keep working. Archives written by earlier releases are kept in the repository (crates/lode-core/tests/corpus). Every build must extract them byte for byte, decrypt them and repair them after damage.
  • Builds without the internet. Each release includes lode-VERSION-source.tar.xz: the source plus that of every crate the desktop app's window toolkit uses. It builds with cargo build --release --offline (see BUILDING-OFFLINE.md inside). rust-toolchain.toml names the exact Rust release used; every Rust release stays downloadable from the Rust project.
  • A binary that runs anywhere. The static lode binary attached to each release needs no libraries at all. Keep a copy next to your backups.

Status and versioning

Lode is at 0.5.0. Version 0.2 added the desktop app; 0.3 opens other archive formats; 0.4 locks archives with SSH keys; 0.5 removed every third-party dependency from the library and the command line. The on-disk format is version 1 and fully documented. Format changes before 1.0 will remain readable by newer releases or come with a migration path. See CHANGELOG.md.

Roadmap

  • Lossless JPEG recompression (DCT-domain re-encoding, ~20 % smaller, bit-exact)
  • Deflate recompression for PNG/zip/gzip/PDF streams (precomp-style)
  • Create zip and tar archives (reading them works since 0.3)
  • Nautilus (GNOME Files) right-click integration
  • Desktop app: mount from the browser
  • Prune old generations and compact archives
  • Parallel chunk hashing and reading for NVMe-speed --fast

Contributing

Issues and pull requests are welcome. Please run cargo fmt, cargo clippy --all-targets and cargo test --workspace before submitting. See CONTRIBUTING.md.

License

Lode is free software, licensed under the GNU General Public License v3.0 or later.

↑↓ navigate↵ open