Skip to main content

KeepassXC-Pwned

PyPi version Codecov Python 3.6|3.7|3.8|3.9 Build Status PRs Welcome

This checks a KeePassXC database against previously cracked haveibeenpwned passwords.

Requirements

  • keepassxc-cli binary (typically installed with KeePassXC)
  • python 3.6 or above

Install

pip3 install keepassxc-pwned

Run

Run: keepassxc_pwned ~/database.kdbx

Usage: keepassxc_pwned [OPTIONS] DATABASE

  Check a keepassxc database against previously cracked haveibeenpwned
  passwords

Options:
  -p, --plaintext       Print breached passwords in plaintext; defaults to
                        sha1 hashes.

  -k, --key-file PATH   Key file for the database
  -v, --verbose         Print debug messages
  -q, --quiet           Don't print status messages, just the summary
  --keepassxc-cli PATH  Specify a different location for the keepassxc-cli
                        binary

  --help                Show this message and exit.

Sample Run:

$ keepassxc_pwned ~/Documents/updated_database.kdbx
Insert password for /home/sean/Documents/updated_database.kdbx:
Checking password for Amazon...
Checking password for Github...
Checking password for Netflix...
Checking password for Steam...
Checking password for letterboxd...
Checking password for linkedin...
Checking password for minecraft...
Found password for 'minecraft' 3 times in the dataset!
Checking password for soundcloud...
Checking password for stackoverflow...
Checking password for wikipedia...
Found 1 previously breached password:
minecraft:5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8:3

You can also import this to use in python code...

from keepassxc_pwned import check_password
check_password("password")

Note: check_password doesn't attempt to do any rate limiting.

... or enter the password manually...

$ python3 -m keepassxc_pwned
Password to check:
Found password 1054 times!

Privacy concerns

This tool only transmits the first 5 characters of the SHA-1 hash of your passwords. You can read more about that here.

Troubleshooting

If keepassxc-cli is named something else on your installation of KeepassXC, specify the full path by providing the --keepassxc-cli flag, like: keepassxc_pwned --keepassxc-cli "$(which keepassxc.cli)" ~/Documents/updated_database.kdbx

If you get the following error while using keepassxc-cli:

dyld: Library not loaded: /usr/local/opt/quazip/lib/libquazip.1.dylib
  Referenced from: /usr/local/bin/keepassxc-cli
  Reason: image not found
Abort trap: 6

... installing quazip should fix that:

  • brew install quazip (Mac)

  • sudo apt install libquazip-dev (Linux)

If keepassxc-cli fails with an error message like "Invalid Command extract.", the command was changed in KeePassXC 2.5.0, and is now called export. Upgrade KeePassXC to the latest version, and try again.

Tests

  • Clone this repository
  • Install dev dependencies: pip3 install -r requirements-dev.txt
  • mypy keepassxc_pwned
  • pytest

Metadata

Release files for keepassxc-pwned 0.3.1

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

Source distribution (sdist)

Source distribution for keepassxc-pwned 0.3.1
File Size Uploaded Provenance
keepassxc-pwned-0.3.1.tar.gz 11.6 kB Without provenance Details

Release files / keepassxc-pwned-0.3.1.tar.gz

Download URL keepassxc-pwned-0.3.1.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ac2e5feb5ef67763390898f580d5452ff60475bffe282456137c9cddabc1ace8
BLAKE2b-256 checksum
How to use checksums
6391be553e6a1b8e552d9623b92556f323d97f4ece2f25f797879c22e1991faa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Security for keepassxc-pwned 0.3.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.

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