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.secret")
This setup stores both the master.password and secrets.yaml in the config/ folder.
🛠️ 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vcrypto-4.2.1.tar.gz.
File metadata
- Download URL: vcrypto-4.2.1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcd65142b11452aa93d23d0cddce6a1fe8bf7f830145f4b7f586693a1937de29
|
|
| MD5 |
7296674636c46c463763e06fe00772d6
|
|
| BLAKE2b-256 |
f650753d86614bcc865cbd06af11e44499cfe32e48149645ecc42c04620f110c
|
File details
Details for the file vcrypto-4.2.1-py3-none-any.whl.
File metadata
- Download URL: vcrypto-4.2.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
538c810d46a8f231ad6974522ba3cc4eae00fa76585b494d9438f8e5635c9f97
|
|
| MD5 |
b14e64beb6a26e17f7f0594e15c0e849
|
|
| BLAKE2b-256 |
5cf5235b7d4945773d1d839e8ba1646169877648fe0c3b9dfbabe3fe3b5288c6
|