Skip to main content

simple-password-generation

Generate and check secure passwords in Python.

This is intended for use as a password strength checking and suggestion library for APIs, though it could also be integrated into a password database application.

Usage

>>> from simple_pass import create_password, check_havebeenpwned, scoring
>>> password = create_password()
>>> print(password)
unfurcate necessitate nonfact retrogradation swathband orthitic

>>> check_havebeenpwned(password)
True
>>> scoring(password)
(True, 75)

HaveIBeenPwned

Generated passwords are automatically securely checked against the HaveIBeenPwned database. Partial hashes are sent using the HaveIBeenPwned API. This can not be reconstructed to determine the checked password.

User generated passwords can be checked by calling check_havebeenpwned(password).

Scoring Options

Passwords can be checked with a scoring based system using the following options.

def scoring(
    password,
    *,
    minimum_length=8,
    minimum_score=20,
    points_for_lower=2,
    points_for_upper=2,
    points_for_numbers=2,
    points_per_special=2,
    special_characters=" !@#$%^&*()-=_+.,<>[]{}/?\\|",
    points_per_character=1,
):

I believe this scoring system encourages long and difficult to guess passwords by rewarding lengthy passwords and special characters, but without requiring a specific password format or frustrating rules.

XKCD, Comics, Horses, and batteries

For wisdom on what makes a good password see the famous xkcd correct horse battery staple comic. The correct horse battery staple example passes with a score of 36 using the default parameters. It does not pass the HaveIBeenPwned check, however, as it is a well known password that has probably been found in many breaches.

Metadata

Release files for simple-pass 1.2

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

Source distribution (sdist)

Source distribution for simple-pass 1.2
File Size Uploaded Provenance
simple-pass-1.2.tar.gz 758.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for simple-pass 1.2
File Interpreter ABI Platform
simple_pass-1.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.5 MB

Release files / simple-pass-1.2.tar.gz

Download URL simple-pass-1.2.tar.gz
Size 758.8 kB
Tags Source
SHA-256 checksum
How to use checksums
432eb0d54346db5db1c9269a5184e7b0eac85d58cf1295804bb93f897cee78ea
BLAKE2b-256 checksum
How to use checksums
b201fe76cb57d072a34a4542e1abb3b4f678f0ce24b1b05e597245fafad49899
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.9.7 Linux/5.15.11-76051511-generic

Release files / simple_pass-1.2-py3-none-any.whl

Download URL simple_pass-1.2-py3-none-any.whl
Size 757.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a9b2d2343f8f6790e7dee9a5531129aa7a136653f715e3d49c910faed13a239
BLAKE2b-256 checksum
How to use checksums
b2d6c7ca7cd796b946a690c9bec643099c4dcde218e4e817869ec49e4f2006b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.9.7 Linux/5.15.11-76051511-generic

Security for simple-pass 1.2

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.

Release history Release notifications | RSS feed

This release

1.2 This release

2 release files No provenance

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