Project Level: Real-World
This project is designed for learners who know Python fundamentals and are learning to build real-world programs.
Project Description
Build a command-line application that evaluates the strength of a password entered by the user. The app will analyze the password based on these criteria:
Length (at least 8 characters long)
The inclusion of uppercase and lowercase letters, numbers, special characters (using the re regular expression library)
Dictionary word detection (the program uses the nltk library to detect if the user is using any common English words and it will not accept such words to make the password more secure).
Here is an example when the user submits a weak password (e.g., mypass):
As you can see the program also prints out some recommendations to provide a strong password.
And here is an example of a strong password:
Learning Benefits
Learn how to use Python’s
re
module for pattern matching.Gain insights into file operations by loading common password dictionaries using the word corpus from the nltk library.
Understand how to provide user feedback and enhance usability.
Develop experience with validating and analyzing strings for real-world scenarios.
Prerequisites
Required Libraries: string, re, nltk
pip install nltk
Required Files: No files are required.
IDE: Use any IDE.
Danger Zone
Here is the code solution:
Happy Coding!
Daily Python Projects Team