Skip to main content

sealedlog

An encrypted, append-only, line-oriented log for JSON records — think SQLite for encrypted append-only JSON logs, minus the SQL. Small, embeddable, no daemon, no external services: just a file format and the code to read and write it correctly.

  • Appending a record is a byte-append to the file — no rewriting, no reordering. Git diffs and merges cleanly on files built this way.
  • Each line decrypts independently. A corrupted or truncated line doesn't block reading the lines before or after it.
  • Lines are bound to the logical stream they were written for. A line copied from one stream into another fails to authenticate, even under the correct key.
  • The key comes from a passphrase via Argon2id, and a wrong passphrase is detected immediately and unambiguously.

See docs/FORMAT.md for the on-disk format and threat model.

Usage

from pathlib import Path
from sealedlog import SealedLog, Vault

vault = Vault.create("correct horse battery staple", namespace="myapp")
key = vault.unlock("correct horse battery staple", namespace="myapp")

log = SealedLog(Path("events.jsonl.enc"), key, "orders", namespace="myapp")
log.append({"order_id": 1, "total": 42})

for record in log:
    print(record)

namespace is your application's own identifier — it, the stream ID, and the library's format version are all folded into the authenticated data for every line, so two different applications never accidentally produce cross-compatible ciphertexts.

Non-goals

sealedlog doesn't know what a "user" or "owner" is, doesn't validate record schemas, doesn't fold or merge records, doesn't decide where files live, and doesn't coordinate concurrent writers to the same file. All of that is application-level policy built on top of a plain sequence of records.

Development

uv sync --all-groups
uv run ruff format --check .
uv run ruff check .
uv run ty check
uv run pytest

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sealedlog-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sealedlog-0.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file sealedlog-0.1.0.tar.gz.

File metadata

  • Download URL: sealedlog-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22","id":"wilma","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sealedlog-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c2281483be9bbee15f8101ef8dbed6639be8fbc69ce0ac155e65fca23b8c7d34
MD5 d58c2b97b3bac7ff245fcb7c8fac9712
BLAKE2b-256 8fb2d61e6a665c6d0c977f99faed8daab8c07783b16c70c036154f42bc4484f9

See more details on using hashes here.

File details

Details for the file sealedlog-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sealedlog-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22","id":"wilma","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sealedlog-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba9310a9079cf91c3acb5b99f2cc9fe7fcdf3c9ad6bff1f970eadfdfbce63a29
MD5 6918a1276339f0a35c993bb6705c683e
BLAKE2b-256 5a1e97adf4cb899001d84ab078831a5f76374201aac0b2d0b58428c3ba31fc58

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page