Skip to content

This Python script is a simple password strength checker. It evaluates a user's password based on length and the presence of uppercase letters, lowercase letters, digits, and special characters. Depending on these criteria, it classifies the password as Weak, Moderate, or Strong to help users create more secure passwords.

Notifications You must be signed in to change notification settings

noobxpropranjal/Simple-Password-Strength-Checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Simple-Password-Strength-Checker

import string

def check_password_strength(password: str) -> str: """ Analyze the strength of a password. Returns: 'Weak', 'Moderate', or 'Strong' """ length = len(password) has_upper = any(c.isupper() for c in password) has_lower = any(c.islower() for c in password) has_digit = any(c.isdigit() for c in password) has_special = any(c in string.punctuation for c in password)

score = sum([has_upper, has_lower, has_digit, has_special])

if length >= 10 and score == 4:
    return 'Strong'
elif length >= 6 and score >= 2:
    return 'Moderate'
else:
    return 'Weak'

def main(): print("=== Password Strength Checker ===") pwd = input("Enter your password: ") strength = check_password_strength(pwd) print(f"🔐 Password Strength: {strength}")

if name == "main": main()

About

This Python script is a simple password strength checker. It evaluates a user's password based on length and the presence of uppercase letters, lowercase letters, digits, and special characters. Depending on these criteria, it classifies the password as Weak, Moderate, or Strong to help users create more secure passwords.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published