Skip to main content

Utility to easily store passwords/secrets

Project description

vcrypto - Secure Secrets Management in Python

vcrypto is a simple and effective utility for securely storing passwords and secrets in Python. It leverages Fernet encryption from the cryptography module instead of reinventing the wheel.

🔒 Why vcrypto?

Managing secrets in Python, especially in collaborative projects, can be cumbersome. Our approach simplifies it:

👉 One master private password (ignored in Git)
👉 A structured dictionary file with encrypted secrets
👉 Easily shareable - only the master password needs to be exchanged once
👉 Version-controlled secrets - since only encrypted values are stored

This package makes it easy to store and retrieve encrypted secrets in JSON or YAML formats.


📌 Features

  • 🔐 AES-128 Encryption (Fernet) for secure storage.
  • 📂 JSON/YAML Support for structured secret storage.
  • 🛠️ Environment Variable Support for flexible key management.
  • 🔑 Simple API for saving and retrieving secrets.

📝 Installation

Install via pip:

pip install vcrypto

🚀 Quickstart

1️⃣ Initialize vcrypto

Before using vcrypto, initialize it with:

from vcrypto import init_vcrypto

init_vcrypto(secrets_file="secrets.yaml", environ_var_name="MY_ENV_VAR")

[!TIP] You only need to initialize it once.

This ensures vcrypto knows where to store secrets and how to retrieve the master password.

2️⃣ Store and Retrieve Secrets

Save a Secret

from vcrypto import save_secret

save_secret("SECRET_TOKEN", "super_secret_value")

Retrieve a Secret

from vcrypto import read_secret

token = read_secret("SECRET_TOKEN")
print(token)  # Output: super_secret_value

⚙️ Customization

The init_vcrypto function allows customization:

Parameter Description
secrets_file Path to the encrypted secrets file (JSON/YAML)
filename_master_password Path to the master password file (optional, defaults to master.password)
environ_var_name Name of an environment variable to retrieve the master password

Example:

init_vcrypto(secrets_file="config/secrets.yaml", filename_master_password="config/master.password")

This setup stores both the master.password and secrets.yaml in the config/ folder.

[!CAUTION] The master password file must never be committed. The bundled .gitignore only excludes *.password, so if you choose a custom name make sure it is covered by your .gitignore. Committing the master password alongside the encrypted secrets.yaml defeats the entire scheme.


🛠️ Development

This project uses uv for dependency management.

Install dependencies

pip install uv
uv venv
uv install

💜 License

This project is licensed under the MIT License.


👤 Author


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

vcrypto-4.3.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

vcrypto-4.3.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file vcrypto-4.3.0.tar.gz.

File metadata

  • Download URL: vcrypto-4.3.0.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for vcrypto-4.3.0.tar.gz
Algorithm Hash digest
SHA256 e58d8711d5c58b623f033b499e7bd4a3d6473be741c0f652a12c925dafadcd05
MD5 da83d2c747dfb0e8023392617f04f295
BLAKE2b-256 95e3bc5c865b68779a5aba087fc11626286566df4bed165c9302965634bd48f3

See more details on using hashes here.

File details

Details for the file vcrypto-4.3.0-py3-none-any.whl.

File metadata

  • Download URL: vcrypto-4.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for vcrypto-4.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6894cfc0c5aef98901e6ee78ce1a0b0706cf2e52403859f383e9e235e7e4f563
MD5 b075806cdba6736155b136e15f7952e0
BLAKE2b-256 bccd641379314bd8fbf8a5f386f5ed2e68cf7f0831068ffbf580f396c05be0f8

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