loz
Command line password manager.
Why?
You may ask why is there a need for another open source password manager. Here are some features that most currently available password managers lack and that loz is focusing on:
-
Designed for command line. Loz allows you to perform all tasks directly on the command line.
- You can pipe the secrets out of it directly to files.
- Bash completion is available for all commands and even domains/usernames.
- Commands are entered directly without loading any custom loz console.
-
Asymmetric encryption. Need to quickly add new entry or generate a password? No problem. With asymmetric encryption, you don't need to type your master password each time you add new entry. It even makes no sense to have to do that, right? You already know what you are entering.
-
Single file storage. Lozfile contains all entries, secrets and encryption keys in a simple json format. You can just copy it over to another machine and continue where you left off.
Requirements
- Python >= 3.10
Install
pip install loz
Setup bash completion
Add the following to your .bashrc or .profile:
eval "$(loz bash-completion)"
Alternatively generate a bash completion file in a directory specific for your system, e.g. for Debian, Ubuntu and Fedora:
loz bash-completion | sudo tee /etc/bash_completion.d/loz
Usage
Initialize lozfile
loz init - This is required first step that will generate storage file at default location ~/.loz. If you want to use a different location or separate storage file, you can specify that with loz -f path/to/lozfile [COMMAND] [OPTIONS], but then you always need to include that switch when using other commands.
You will be asked to enter the master password which will be required for decrypting your secrets. Read more about the lozfile, what it contains, what is being encrypting and what it's always revealing in the lozfile section of this doc.
Add secret
loz add mydomain.com username@email.com - After this you will be prompted to enter your secret in a multi-line prompt. Press Alt-Return to save.
If you want loz to generate a secret for you, just use loz make mydomain.com username@email.com instead. It will generate and save a new secret and print it out for you.
Read secret
loz get mydomain.com username@email.com - After this you will be prompted for the master password. Note that you can autocomplete name of domains and usernames by pressing Tab.
loz show mydomain.com will print all secrets for all usernames under selected domain.
List entries
loz ls will list domains and loz ls mydomain.com will list usernames under selected domain.
loz find searchword will list all domains and/or usernames that contain a word searchword.
Delete an entry
loz rm mydomain.com username@email.com will delete selected username. If that's the only username under selected domain, the whole domain will be removed. If you want to delete a domain with all usernames under it, just type loz rm mydomain.com.
Export/Import
loz export > backup.csv will export all secrets in a plain text csv file. You can import a backed up file with loz import backup.csv. It will ask you if you want to overwrite existing entries.
Change password
loz passwd will prompt you for old and new password. It will then generate new keys and re-encrypt all secrets.
Development
Clone the repository and create a virtual environment:
git clone git@gitlab.nul.one:mush/loz.git
cd loz
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
Running checks
# Lint
ruff check loz/ tests/
# Format check
ruff format --check loz/ tests/
# Type check
mypy loz/
# Tests with coverage
pytest
# Build and verify distribution
python -m build
twine check dist/*
Pre-commit hooks
pre-commit install
pre-commit run --all-files
Lozfile and encryption
Lozfile is the json storage of all secrets. It contains plaintext RSA public key and Fernet (password) encrypted private key as well. Public key is used in the background when you are entering or generating new secrets. Private key is useless without your master password, but weak password means weak encryption.
All secrets are encrypted with RSA 4096. This is slow for encryption and decryption, but allows the asymmetric approach and doesn't have a big performance impact on short secrets.
Password generation uses secrets.choice (the Python standard-library CSPRNG) to ensure cryptographic strength.
Compatibility
Backwards compatibility will be guaranteed for all lozfiles created with loz versions 0.1.0 and above. If there is a change in lozfile format, you may be prompted to update your lozfile.
WARNING
Lozfile is revealing domains and usernames. This is by design to enable autocomplete. Future versions of loz may offer full encryption option, but for now it's not available and it's not a focus. If you are concerned about privacy of your usernames, then loz is not for you!
Metadata
Release files for loz 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| loz-0.2.1.tar.gz | 21.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| loz-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.3 kB
Release files / loz-0.2.1.tar.gz
| Download URL | loz-0.2.1.tar.gz |
|---|---|
| Size | 21.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4fab1952e47165616c5dcfac7852906a8ff0856464af4218035dc9dc3f6aea4
|
|
BLAKE2b-256 checksum How to use checksums |
fdb29909f5ba1abefafafe51cf3c9bd844cea67aaf0df964d15c22fff8cc332c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / loz-0.2.1-py3-none-any.whl
| Download URL | loz-0.2.1-py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2390870f7a0c9303ac8de30a6c1270f9ff01040d4067c81d5f18ecb1ce6633de
|
|
BLAKE2b-256 checksum How to use checksums |
f01e32652ab610a49db054ad51ceb929e0d21b9372f3d813539d262808ce7abc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Security for loz 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.