Encrypted file keyring backend
Low maintenance activity. Last release over 4 years ago, commits in 1 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install keyrings-cryptfileSummary
Encrypted plain file keyring backend for use with the keyring package.
Description
The project is mainly targeted on a sufficiently secure storage for plain text passwords (keyring) in a simple portable file, where the default keyring storage implementation of a usual desktop environment doesn't fit.
Cryptography
The keyring is secured with a keyring password. A raw
Argon2($argon2id$v=19$m=65536,t=15,p=2) hash is generated from the keyring
password, which is used as a key for encryption of plaintext passwords in one of
the supported authenticated AES encryption schemes (CCM, EAX, GCM, OCB), where
GCM is the default. The resulting encrypted data is persisted, together with the
Argon2 salt, nonce and MAC. This value is stored with a service/userid reference
in a text file (.ini format). The service/userid is taken into account as
associated data for MAC calculation.
Initially, a static reference value, treated as a password is stored as well, and this value is used for verification of the keyring password in subsequent accesses.
Attack surface
The static reference value allow some form of attack, as it encrypts a well known value. Hopefully, the Argon2 hash, combined with the authenticated AES encryption scheme raises the effort to break the key sufficiently high.
The Argon2 parameterization is chosen in a way, that usual desktop and server systems as of today (2017) have to process a significant CPU and Memory load in order to calculate the hashes, which renders brute force attacks impractical.
The authenticated AES encryption scheme prevents tampering with the encrypted data as well as its reference (service/userid).
Quick start guide
In order to get you started, you will need to have a python3 environment
and git available (preferably on a linux system).
You might want to provide the python packages argon2-cffi, keyring, pycryptodome
and their dependencies (most notably SecretStorage and cryptography) with your
system package management, or use a local venv, but that will depend on a
properly working C compiler and some development packages installed
(python-devel and openssl-devel at least).