Skip to content

Add a password strength checker (regex practice) #20

Description

@utk2103

Add a script that scores how strong a password is and says what's missing.

Why

Best introduction to the re module there is, because every rule is one pattern. It also pairs with the password generator in #7 — generate one, then score it.

Suggested file

scripts/password_strength_checker.py

What it should do

  • Usage: python scripts/password_strength_checker.py then type a password (or pass it as an argument).
  • Check: length ≥ 12, lowercase, uppercase, digit, symbol, no common sequences (1234, abcd, qwerty), not in a small built-in list of very common passwords.
  • Print a score out of 5, a verdict (Weak / Fair / Strong), and a bullet list of what's missing.

Acceptance criteria

  • Rules are a list of (regex, message) pairs looped over — not five copy-pasted if blocks.
  • Standard library only (re, argparse, getpass).
  • Prefers getpass.getpass() for interactive input so the password isn't echoed or stored in shell history.
  • assert-based self-check proving a known weak password scores low and a known strong one scores high.
  • A comment stating this is heuristic feedback, not a security guarantee.

Inspiration

Password_Strength-checker from Awesome-Python-Scripts.

Good first issue — comment below to get assigned.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions