Skip to main content

🔐 Python Password Manager

A modular, secure, and easy-to-use password manager featuring a professional CLI interface, an interactive menu (TUI) with arrow-key navigation, a pytest suite covering the cryptographic core, vault storage and CLI, and CI/CD.

PyPI version Python CLI TUI Encryption KDF

License Tests CD


🚀 Key Features

  • Modular Architecture: Full separation between the cryptographic logic (core) and the CLI/storage interface.
  • Interactive Menu (TUI): Running passmgr with no arguments opens an arrow-key navigation menu built with questionary and rich, offering List / Get / Add / Delete / Generate options directly from the menu.
  • Strong Security: Key derivation via PBKDF2-HMAC-SHA256 (600,000 iterations by default, following OWASP guidance) and Fernet authenticated encryption (AES-128-CBC + HMAC-SHA256).
  • Safe Storage: Atomic vault writes (temporary file, fsync, then replace), so an interrupted save never corrupts the vault; owner-only file permissions (0600 on Linux/macOS).
  • Local Encrypted Storage: The vault is stored in a single encrypted file (vault.json).
  • Dedicated CLI Shortcut: Run the passmgr command directly from the terminal, with or without subcommands.
  • Clipboard Integration: Quick password copying with a single keypress or a CLI flag (using pyperclip). The clipboard is cleared after 30 seconds, and only if it still holds the copied password.
  • Testing & CI/CD: pytest suite with coverage reporting on Python 3.10–3.13, and automated PyPI deployment on tagged releases via GitHub Actions.

Project Structure 📂

PASSWORD_MANAGER/
├── .github/
│   └── workflows/
│       ├── publish.yml
│       └── test.yml
├── src/
│   └── password_manager/
│       ├── cli/
│       │   ├── __init__.py
│       │   └── main.py
│       ├── core/
│       │   ├── __init__.py
│       │   ├── crypto.py
│       │   └── vault.py
│       ├── __init__.py
│       └── clipboard.py
├── tests/
│   ├── test_cli.py
│   ├── test_clipboard.py
│   ├── test_crypto.py
│   └── test_vault.py
├── .gitignore
├── LICENSE
├── pyproject.toml
├── README.md
└── requirements.txt


📦 Installation & Running

pip install razeini-password-manager

Option 2: Install for Development

1. Clone the repository:

git clone https://github.com/RazEini/Password_Manager.git
cd Password_Manager

2. Install the package in editable mode:

pip install -e .

3. Run unit tests:

pip install -r requirements.txt
pytest --cov=src --cov-report=term-missing

🖥️ Interactive Mode (TUI)

Running the passmgr command without a subcommand opens a full interactive menu (requires rich and questionary):

passmgr
# or with a specific vault file:
passmgr --vault myvault.json

The menu automatically detects whether the vault exists:

  • If it doesn't exist — it will offer to create a new vault with a master password.
  • If it exists — it will prompt for the master password to unlock it.

Once unlocked, an arrow-key navigation menu is displayed with the following options:

Menu Option Description
List All Services Display all services saved in the vault
Get Entry View entry details, including an option to copy the password to the clipboard
Add / Update Entry Add a new entry or update an existing one, with an option to generate a random password
Delete Entry Delete an entry from the vault after confirmation
Generate Random Password Generate a random password only, without saving it to the vault
Lock & Exit Lock the vault and exit the menu

💻 CLI – Main Commands (`passmgr`)

Command Description Example
(no command) Open the interactive menu (TUI) passmgr
init Create a new encrypted Vault passmgr init
add Add or update a password for a service passmgr add --service github --user myusername
get Retrieve a password. With --copy the clipboard is cleared after 30 s (--clear-after N to change, 0 to disable) passmgr get --service github --copy
list List all existing services in the vault passmgr list
delete Delete an entry from the vault passmgr delete --service github
change-master Change the master password and re-encrypt passmgr change-master
generate Generate a strong random password passmgr generate --length 20
export-csv Export passwords to a CSV file (plaintext, created owner-only) passmgr export-csv --path backup.csv
import-csv Import passwords from a CSV file passmgr import-csv --path backup.csv

💡 Note on Custom Vault Names:
By default, passmgr uses vault.json in the current working directory. If you want to use a custom file name (e.g., myvault.json), append --vault <filename> to any command:

passmgr --vault myvault.json init
passmgr --vault myvault.json add --service github --user myusername

🛡️ Security & Key Derivation

The application never stores the master password on disk. The key is derived in real time from the master password and the per-vault random salt stored in the vault file, and the vault file holds only the KDF parameters and the Fernet ciphertext (service names, usernames and notes are encrypted too). Password entry uses getpass in CLI mode and questionary.password in the TUI, so characters are never echoed.

What is in place

  • Key derivation: PBKDF2-HMAC-SHA256, 600,000 iterations by default, with a fresh 16-byte salt per vault and on every master-password change.
  • Authenticated encryption: Fernet (AES-128-CBC + HMAC-SHA256). A wrong password or a tampered file fails authentication and never yields partial data.
  • Durable writes: the vault is written to a temporary file in the same directory, flushed and fsynced, then atomically swapped in with os.replace(). A crash or full disk leaves the previous vault intact.
  • File permissions: the vault (and CSV exports) are created owner-only (0600) on Linux and macOS.
  • Clipboard hygiene: copied passwords are cleared after 30 seconds, unless you copied something else in the meantime.

Upgrading an older vault. Each vault stores its own iteration count, so vaults created with the previous default (390,000) keep working. passmgr prints a hint when it opens one, and passmgr change-master re-encrypts it at the current default. Passing a lower value with --iterations prints a warning.

Scope and limits

  • export-csv writes your passwords in plaintext by design. Delete the file when you are done.
  • While the program is running, the master password and decrypted entries exist in process memory; there is no memory locking or secure wipe (a Python limitation).
  • On Windows, 0600 maps only to the read-only bit, so rely on the user profile's NTFS permissions.
  • Clipboard managers or other programs may read the clipboard before it is cleared.

📄 License

This project is distributed under the MIT license – free to use, modify, and distribute. For more information, see the LICENSE file.


👨‍💻 Raz Eini (2026)

Metadata

Release files for razeini-password-manager 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for razeini-password-manager 0.2.3
File Size Uploaded Provenance
razeini_password_manager-0.2.3.tar.gz 22.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for razeini-password-manager 0.2.3
File Interpreter ABI Platform
razeini_password_manager-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 38.5 kB

Release files / razeini_password_manager-0.2.3.tar.gz

Download URL razeini_password_manager-0.2.3.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
dc2e903dc8dabc40d6b9bf65eca1da2950e2113b8f83f478e79999bce1688d0a
BLAKE2b-256 checksum
How to use checksums
1f732ac0746a5888576c58b7b19c607d18420d818dca42bc681a4af0eea508d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / razeini_password_manager-0.2.3-py3-none-any.whl

Download URL razeini_password_manager-0.2.3-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e956fcc3dbae52c1ffd418e3b270bf023016d313667c27d510fdaa8914e918a
BLAKE2b-256 checksum
How to use checksums
062a1c4738929766279ace7b13b60028b37e2ee50090123ff4e20e99271bc2dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for razeini-password-manager 0.2.3

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for razeini_password_manager-0.2.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page