Skip to content

securitymedium

Password Policy Checker

150 points · 0 solved

The first line is T. Each of the next T lines is username password (one space; neither contains spaces; both printable ASCII). Check these rules in this order:

  1. LENGTH — at least 12 characters
  2. UPPER — contains A–Z
  3. LOWER — contains a–z
  4. DIGIT — contains 0–9
  5. SYMBOL — contains a character that isn't an ASCII letter or digit
  6. REPEAT — no character three or more times in a row
  7. USERNAME — must not contain the username (case-insensitive)

Print OK, or the failed rule names joined by commas.

3
alice Summer2026!
bob CorrectHorse#42
trav traven12345
LENGTH
OK
LENGTH,UPPER,SYMBOL,USERNAME
Learn the technique/learn/web-app-security

main.py