Jump to content

Featured Replies

Posted

Write a program that checks the strength of a password based on the following criteria:

Password Strength Rules:

  • Must be at least 8 characters long.
  • Must contain at least one uppercase letter.
  • Must contain at least one lowercase letter.
  • Must contain at least one number.
  • Must contain at least one special character (e.g., !@#$%^&*()).

Program Requirements:

  1. Accept user input for the password.
  2. Check the password against the rules and rate it as:
    • Weak if it meets 1-2 rules.
    • Moderate if it meets 3-4 rules.
    • Strong if it meets all 5 rules.
  3. Provide feedback to the user on what the password is missing.

Bonus:

  • Implement a feature to generate a strong password if the userโ€™s input is weak.
  • Use regular expressions for efficient rule checking.

Example Output:

Enter your password: password123
Your password is Moderate.
Suggestions: Add a special character to make it stronger.

Happy coding! ๐Ÿ˜Š

CodeName: Jessica

๐Ÿ’ป Linux Enthusiastย | ๐ŸŒ Adventurerย | ๐Ÿฆ„ Unicornย 
๐ŸŒ My Siteย | ๐Ÿ“ข Join the Forum

spacer.png

ย 

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.