Encrypted environment variable vault with AI access policies, keeping secrets safe from AI agents
Project description
EnvCP Python Binding
Native Python binding for EnvCP - an encrypted environment variable vault with AI access policies. Built on Rust + PyO3 for zero-dependency native performance.
Installation
pip install envcp-core
Or with pipx:
pipx install envcp-core
Usage
from envcp import encrypt, decrypt, StorageManager
# Crypto operations
ciphertext = encrypt("my-secret-value", "my-password")
plaintext = decrypt(ciphertext, "my-password")
# StorageManager for encrypted vault files
sm = StorageManager("~/.envcp/vault.json", encrypted=True)
sm.set_password("my-password")
# Load, get, set, delete, list
vault_json = sm.load()
sm.set("API_KEY", '{"value":"secret","protected":false}')
sm.get("API_KEY")
sm.list()
sm.delete("API_KEY")
API Reference
Crypto Functions
| Function | Description |
|---|---|
encrypt(plaintext, password) -> str |
AES-256-GCM encrypt with Argon2id |
decrypt(ciphertext, password) -> str |
Decrypt v1 (PBKDF2) or v2 (Argon2id) |
hash_password(password) -> str |
Argon2id password hash |
verify_password(password, hash) -> bool |
Verify password hash |
generate_recovery_key() -> str |
Generate 32-byte recovery key |
create_recovery_data(password, key) -> str |
Create encrypted recovery blob |
recover_password(data, key) -> str |
Recover password from recovery data |
hmac_sign(key, data) -> str |
HMAC-SHA256 signature |
hmac_verify(key, data, expected) -> bool |
Timing-safe HMAC verification |
generate_id() -> str |
Random ID |
generate_session_token() -> str |
Session token |
StorageManager Class
| Method | Description |
|---|---|
StorageManager(path, encrypted=True) |
Create manager for vault at path |
set_password(password) |
Set encryption password |
invalidate_cache() |
Clear in-memory cache |
exists() -> bool |
Check if vault file exists |
load() -> str |
Load full vault as JSON string |
get(name) -> Optional[str] |
Get single variable as JSON |
set(name, var_json) |
Set variable (var_json is JSON string) |
delete(name) -> bool |
Delete variable, returns True if existed |
list() -> List[str] |
List all variable names |
Requirements
- Python 3.9+
- No Node.js dependency (native Rust binding)
Building from Source
git clone https://github.com/fentz26/EnvCP
cd EnvCP
cargo build --release -p envcp-python
For wheel distribution:
pip install maturin
cd crates/envcp-python
maturin build --release
Links
- Homepage: https://envcp.org
- Documentation: https://envcp.org/docs
- GitHub: https://github.com/fentz26/EnvCP
- npm (Node.js): https://www.npmjs.com/package/@fentz26/envcp
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 envcp-1.2.0.tar.gz.
File metadata
- Download URL: envcp-1.2.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d162b32616574bde30179d4cfe4e8b1e1fe2892008edbc9894dd048be35163f5
|
|
| MD5 |
00f28b44234cc56ef22d942e0ae608eb
|
|
| BLAKE2b-256 |
1085c96db4cfd3429e415efb00a69cb2e94bd526c75ed41bda3f10a136a20f7c
|
Provenance
The following attestation bundles were made for envcp-1.2.0.tar.gz:
Publisher:
publish.yml on fentz26/EnvCP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
envcp-1.2.0.tar.gz -
Subject digest:
d162b32616574bde30179d4cfe4e8b1e1fe2892008edbc9894dd048be35163f5 - Sigstore transparency entry: 1340070668
- Sigstore integration time:
-
Permalink:
fentz26/EnvCP@cf9b8d6f664c60d674fd1a11ca33faafe368b55a -
Branch / Tag:
refs/tags/v1.2.0-beta.1 - Owner: https://github.com/fentz26
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cf9b8d6f664c60d674fd1a11ca33faafe368b55a -
Trigger Event:
push
-
Statement type:
File details
Details for the file envcp-1.2.0-py3-none-any.whl.
File metadata
- Download URL: envcp-1.2.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8746869f726ba3fd6fc9af834248d900eaf863cedf8e55964f167e655804408c
|
|
| MD5 |
ab5f23378ea490fe478c68744151cae3
|
|
| BLAKE2b-256 |
f70aa1690c3425f6c117a6982d3efd78626bd4673c60ad23e921aa2c3c2a9110
|
Provenance
The following attestation bundles were made for envcp-1.2.0-py3-none-any.whl:
Publisher:
publish.yml on fentz26/EnvCP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
envcp-1.2.0-py3-none-any.whl -
Subject digest:
8746869f726ba3fd6fc9af834248d900eaf863cedf8e55964f167e655804408c - Sigstore transparency entry: 1340070678
- Sigstore integration time:
-
Permalink:
fentz26/EnvCP@cf9b8d6f664c60d674fd1a11ca33faafe368b55a -
Branch / Tag:
refs/tags/v1.2.0-beta.1 - Owner: https://github.com/fentz26
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cf9b8d6f664c60d674fd1a11ca33faafe368b55a -
Trigger Event:
push
-
Statement type: