Skip to main content

Git-friendly encrypted .env files with cleartext keys and sealed values (SOPS-inspired structural encryption).

Project description

dotseal

Tests Lint codecov PyPI Python License: MIT

Git-friendly encrypted .env files with cleartext keys and sealed values.

dotseal encrypts only variable values, so you can safely commit .env.enc, review diffs, and keep secrets out of git history.

  DATABASE_URL=ENC[AES_GCM,data:Zm9vYmFy...]
- DEBUG=ENC[AES_GCM,data:TXVzaWM=]
+ DEBUG=ENC[AES_GCM,data:b3RoZXI=]
  API_KEY=ENC[AES_GCM,data:c2VjcmV0...]

Installation

pip install dotseal

Requires Python 3.9+. Using uv? uv add dotseal.

Quickstart

# 1) Generate a local key (saved to .dotseal.key and gitignored)
dotseal init

# 2) Encrypt .env -> .env.enc (commit .env.enc only)
dotseal encrypt

# 3) Decrypt when needed
dotseal decrypt

Runtime load (no cleartext file required):

from dotseal import load_env

load_env()  # reads .env.enc and injects decrypted values into os.environ

Not sure which mode to use?

  • Solo or small trusted setup: start with symmetric mode (dotseal init + dotseal encrypt).
  • Team sharing without distributing one shared secret: use asymmetric mode.
  • If you are unsure, start symmetric and switch later when sharing/revocation needs grow.
  • Details: Asymmetric mode, Key management.

What gets committed?

File Commit it? Why
.env.enc Yes Encrypted values with reviewable keys
.env No Cleartext secrets
.dotseal.key Never Symmetric master key
.dotseal.prv Never Asymmetric private key
dsk-pub-... Yes Asymmetric public keys are safe to share

Documentation

Use the docs as the source of truth for all details:

Security

  • AES-256-GCM authenticated encryption with per-value nonces.
  • Variable names are bound as AAD, so ciphertext cannot be swapped across keys.
  • Integrity is per value (review .env.enc changes like code changes).

Report vulnerabilities privately via SECURITY.md.

Contributing

See CONTRIBUTING.md.

License

MIT

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

dotseal-0.2.1.tar.gz (706.7 kB view details)

Uploaded Source

Built Distribution

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

dotseal-0.2.1-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file dotseal-0.2.1.tar.gz.

File metadata

  • Download URL: dotseal-0.2.1.tar.gz
  • Upload date:
  • Size: 706.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dotseal-0.2.1.tar.gz
Algorithm Hash digest
SHA256 1a84e77c24aa3f3a940b1c2c16949642594ce142a38e0bd46bd5ae9fffd7841e
MD5 d9a2e4f141b8518f466f2bbd94f74964
BLAKE2b-256 b626d6ce1bca22e0fca915bb9ce0afe5837390b9cfc468871aece4f4cff06971

See more details on using hashes here.

Provenance

The following attestation bundles were made for dotseal-0.2.1.tar.gz:

Publisher: publish.yml on Jastchi/dotseal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dotseal-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: dotseal-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dotseal-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f7219faed1646619927c8173ea729c9ca6eb18ca616ac6aa551cbb136778fb7
MD5 6d8b692b50d4dc7f763a69e2fb8a2204
BLAKE2b-256 33b757855daffd12294c5c967f23ebb3e2cee41fe53a2942db1e36e52d506485

See more details on using hashes here.

Provenance

The following attestation bundles were made for dotseal-0.2.1-py3-none-any.whl:

Publisher: publish.yml on Jastchi/dotseal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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