keyrings.cryptfile
Encrypted file keyring backend
What it is and what it does
keyrings.cryptfile provides an encrypted file-based keyring backend for the keyring package, designed for scenarios where the system's default keyring storage (like GNOME Keyring or KDE Wallet) is unavailable or unsuitable. It stores passwords in a portable .ini-format file secured with Argon2 key derivation and authenticated AES encryption (GCM by default), with support for CCM, EAX, and OCB schemes.
The package encrypts each password with a keyring master password, deriving an Argon2 hash that serves as the encryption key. Service and user identifiers are included as associated data in the authenticated encryption, preventing tampering. The resulting encrypted data, salt, nonce, and MAC are stored in a text file. Operations are intentionally slow (around 1 second per call) due to the Argon2 KDF, which raises the computational cost of brute-force attacks.
Use it for:
- Store API keys and database passwords in a portable encrypted file for development environments without a system keyring.
- Secure credential storage in containerized or headless systems where desktop keyring services are unavailable.
- Protect plaintext passwords in configuration files by replacing them with keyring lookups.
- Implement password management in cross-platform scripts that need consistent credential handling.
- Archive encrypted credentials in version control or backups with protection against casual inspection.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A keyring backend that stores passwords in an encrypted file using Argon2 key derivation and authenticated AES encryption, integrating with the keyring package for portable credential storage.
Yes, with conditions. Install if you need portable encrypted password storage and can tolerate high build friction (C compiler, development headers) and the ~1 second delay per password operation. The MIT license and active maintenance are favorable. Skip if your system already has a working keyring service or if build dependencies are unavailable; the package is not suitable for high-frequency password access due to intentional KDF slowness.
Install
keyrings-cryptfile on PyPI
pip
pip install keyrings-cryptfileuv
uv add keyrings-cryptfilepoetry
poetry add keyrings-cryptfileInstalling keyrings.cryptfile
Before you install
High install friction: the package requires compilation of cryptographic dependencies (argon2-cffi, pycryptodome, cryptography) and system development packages (python-devel, openssl-devel). Maintenance is active with a recent commit (2026-06-26), though the latest release is from 2022-11-20.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
from keyrings.cryptfile.cryptfile import CryptFileKeyring
kr = CryptFileKeyring()
kr.set_password("service", "user", "secret")
password = kr.get_password("service", "user")
Requires C compiler and development headers (python-devel, openssl-devel) to build cryptographic dependencies; KDF operations introduce ~1 second delay per password operation.
Verify before relying
- Whether the Argon2 parameters (m=65536, t=15, p=2) remain resistant to modern attacks beyond 2017.
- Current security posture of the static reference value encryption scheme against known-plaintext attacks.
- Whether keyring integration requires additional setup beyond instantiation.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,363 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 391,796/month — #7,012 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: keyrings.cryptfile-1.3.9.tar.gz
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
keyringKeyring provides safe password and credential…
permissive · top 1,000 on PyPI
keyrings.altProvides alternate keyring backend…
permissive · top 5,000 on PyPI
SecretStorageProvides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
spake2Implements SPAKE2, a password-authenticated key…
permissive · top 15,000 on PyPI
aws-encryption-sdkEncrypts and decrypts data using AWS KMS keys…
permissive · top 5,000 on PyPI
hkdfImplements HMAC-based Key Derivation Function…
permissive · top 15,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
argon2-cffiProvides a simple Python interface to Argon2, a…
permissive · top 1,000 on PyPI
aes-pkcs5Provides AES encryption and decryption with…
permissive · top 15,000 on PyPI
borgbackupBorgBackup is a command-line deduplicating…
permissive · top 15,000 on PyPI