Metadata-Version: 2.4
Name: password-entropy-meter
Version: 1.0.0
Summary: Tiny zero-dependency library to estimate password entropy (bits), character-set composition and a strength label.
Author: ricco020
License: MIT
Project-URL: Homepage, https://www.pwdfortress.com/en/tools/password-strength-checker
Project-URL: Repository, https://github.com/ricco020/password-entropy-meter
Keywords: password,entropy,security,strength,passphrase,nist
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Security
Classifier: Intended Audience :: Developers
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# password-entropy-meter

Tiny, zero-dependency Python library to estimate **password entropy** (in bits), character-set composition, and a strength label.

> ⚠️ Character-set entropy is a *theoretical upper bound*. It **overstates** the strength of human-chosen passwords (dictionary words, `P@ssw0rd!`-style patterns). For realistic guess estimation, use a model such as zxcvbn. Use this for quick checks and education.

## Install

```bash
pip install password-entropy-meter
```

## Usage

```python
from password_entropy_meter import estimate, entropy_bits

estimate("correct horse battery staple")
# {'length': 28, 'charset': 26, 'bits': 131.6, 'strength': 'very strong'}

estimate("P@ssw0rd!")
# {'length': 9, 'charset': 95, 'bits': 59.1, 'strength': 'reasonable'}  # but trivially guessable in practice

entropy_bits("hunter2")   # 32.9
```

## Why length beats complexity

Each extra *random* character multiplies the search space; composition rules add entropy only once. A random multi-word passphrase reaches very high entropy that is actually realised, because the words are chosen randomly. See a browser-based checker (entropy + breach exposure) at **[PwdFortress](https://www.pwdfortress.com/en/tools/password-strength-checker)**.

## API

- `entropy_bits(password) -> float` — bits = `length * log2(charset_size)`
- `charset_size(password) -> int`
- `estimate(password) -> dict` — `{length, charset, bits, strength}`

## License

MIT
