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! 😊

  • Views 76
  • Created
  • Last Reply

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

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.