Skip to main content

Encrypted document DB for Python developers. Like SQLite, but with built-in trust, end-to-end encryption, and a zero-config CLI.

Project description

๐Ÿ” VaulteDB

Coverage

SQLite for encrypted documents.
All the simplicity of SQLite โ€” but your data is always encrypted, always private.

VaulteDB is a zero-config, encrypted document database for Python developers who want built-in security without dealing with cryptography directly.

  • โšก Fast local JSON-backed store
  • ๐Ÿ” AES-256 encryption using Fernet
  • ๐Ÿง  Pythonic .insert(), .get(), .find() API
  • ๐Ÿง‚ Salt-based key derivation per vault
  • ๐Ÿ” Inspectable, portable .vault file format
  • ๐Ÿงฐ Optional CLI tool for safe metadata inspection
  • ๐Ÿ“† Append-only encrypted audit log (optional)
  • ๐Ÿ—ƒ๏ธ Single-file storage with embedded metadata and salt

๐Ÿš€ Quick Start

from vaultedb import vaultedb

vault = vaultedb.open("notes.vault", "correct horse battery staple")
vault.insert({"_id": "alice", "email": "alice@example.com"})

print(vault.get("alice")['email'])

โœจ Why VaulteDB?

  • โŒ SQLCipher: low-level SQL only
  • ๐Ÿ” MongoDB: enterprise-only FLE, complex setup
  • โšก Evervault: hosted service, not a library
  • ๐Ÿš€ vaultedb: open-source, local, encrypted, and simple

โญ Design Principles

๐Ÿ” Zero-Config Encryption

VaulteDB encrypts every document automatically. Developers only provide a passphrase. vaultedb handles:

  • Key derivation (PBKDF2)
  • AES-256 encryption (via Fernet)
  • Embedded salts

๐Ÿง‚ Salt-Based Key Derivation

Each vault embeds a unique salt. Even with the same passphrase, every vault is isolated.

"salt": "base64-encoded-value"

โœ… Vault Isolation Guarantee

Same passphrase โ‰  same key. Copying blobs across vaults doesn't work:

vault1 = vaultedb.open("vault1.vault", "hunter2")
vault2 = vaultedb.open("vault2.vault", "hunter2")

vault1.insert({"_id": "secret", "msg": "top secret"})
vault2.store.insert(vault1.store.data["secret"])

from vaultedb.errors import CryptoError
try:
    vault2.get("secret")
except CryptoError:
    print("โœ… Vaults are isolated by salt")

๐Ÿ“… Portable File Format

Each .vault file is valid JSON:

{
  "_meta": {
    "vault_version": "1.0.0",
    "created_at": "...",
    "salt": "...",
    "app_name": "..."
  },
  "documents": {
    "abc123": {"_id": "abc123", "data": "gAAAAB..."}
  }
}

๐Ÿ” CLI Inspector: Trust Without Decryption

vault inspect notes.vault
python -m vaultedb.cli inspect notes.vault --json --quiet

See vault metadata, salt, and IDs without ever decrypting.


๐Ÿ—“๏ธ Logging: Encrypted Audit Trails (Optional)

Enable audit logging:

vault = vaultedb.open("secure.vault", "hunter2", enable_logging=True)
vault.insert({"_id": "day1", "note": "Encrypted entry"})

All actions are encrypted and logged to .vaultlog:

{
  "op": "insert",
  "_id": "day1",
  "at": "2025-05-13T11:00:00Z",
  "meta": {}
}
  • โœ‰๏ธ Export logs with vault.get_audit_log().export_json("out.json")
  • ๐Ÿšจ Detect tampering: logs can't be forged or decrypted without key

โฌ† MVP Status: Complete

This project is currently an MVP focused on local security and DX:

  • โœ… Local document storage
  • โœ… Transparent encryption
  • โœ… Key export
  • โœ… CLI inspector
  • โœ… Optional audit logging

Planned post-MVP:

  • Indexing and query optimization
  • Vault sync over S3 or filesystem
  • Multi-user vault support

๐Ÿ”— Use Cases

  • ๐Ÿ“‹ Local note-taking with privacy
  • ๐Ÿง‘โ€๐Ÿ’ป AI agents storing context
  • ๐Ÿ’ผ Secure local logging in compliance environments
  • ๐Ÿš— Field apps storing offline snapshots securely

๐Ÿ“Š Test Coverage

  • 94%+ tested
  • Core coverage: encryption, storage, logging, passphrase
  • CLI tested via subprocess

๐Ÿ“ฆ Installation

pip install vaultedb  # or use poetry install if cloning locally

๐ŸŽฅ Demo & Examples


๐ŸŒŸ Support vaultedb

  • โญ Star us on GitHub: vaultedb
  • ๐Ÿ“ข Share your feedback
  • ๐Ÿ“ฑ Try the demo or install from PyPI

Built for developers who take privacy seriously.


๐Ÿšฉ License

MIT ยฉ 2025 VaulteDB Project

Project details


Download files

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

Source Distribution

vaultedb-1.0.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

vaultedb-1.0.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file vaultedb-1.0.0.tar.gz.

File metadata

  • Download URL: vaultedb-1.0.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for vaultedb-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6b2878e81c8f5752942afcbe506b5f76c228acc49e57c44ad0ba2b5fff0acbc3
MD5 f15a3cbf7548b9fbd516d8b033f025a0
BLAKE2b-256 5aa55b1d6305842837bb7b4511799c9355e3c91799d7ceb9e0a428e1cfc67f95

See more details on using hashes here.

File details

Details for the file vaultedb-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: vaultedb-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for vaultedb-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 323158b69eec7212958b248039fef1c53a50a9acf5208e11482bae2db59f6d43
MD5 079f4d0dca90457775bce65939ec7395
BLAKE2b-256 3bca5de64e682f7babb0b7bcf88b584734681552482b0042494a634c1868f669

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page