DEV Community

Mohana Vamsi
Mohana Vamsi

Posted on

Password Strength Checker

This preserves the beauty of this Python project where it qualifies the strength of passwords in regard to the quality of the password such as the length of the password, presence of upper case, lower case, numbers, and special characters. The purpose of the app is to improve password clarity and thus develop more secure passwords among the users.

Code Example:

``
import re

def check_password_strength(password):

if len(password) < 8:

return "Weak: Too short"

if not re.search("[A-Z]", password):

return "Weak: Add uppercase letters"

if not re.search("[0-9]", password):

return "Weak: Add numbers"

if not re.search("[@#$%^&*]", password):

return "Weak: Add special characters"

return "Strong password"

password = input("Enter a password: ")

print(check_password_strength(password))

``
This tool is used for the purpose of determining the password strength.

Use Case: It can be run willfully by organizations or any individual user who wants to enforce stronger password policies. It can be extended to give suggestions on passwords or monitor frequently used bad passwords.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay