Welcome to the Password Strength Analyzer, a Python-based tool that evaluates password strength using machine learning and generates secure passwords. This project leverages a custom linear regression model to predict password entropy and provides a user-friendly interface with rich text formatting.
- Password Strength Analysis: Evaluates password complexity based on features like length, character types, and entropy.
- Secure Password Generation: Generates random, secure passwords with customizable options (length, uppercase, digits, special characters).
- Machine Learning Model: Uses a custom linear regression model trained on the RockYou dataset to predict password entropy.
- Interactive CLI: Features a colorful, terminal-based interface using
richandpyfigletfor a polished user experience. - Data Visualization: Generates plots to visualize password entropy data and model predictions.
./
├── data/
│ ├── raw/
│ │ ├── rockyou.txt # Raw password dataset
│ ├── processed/
│ │ ├── password_features.csv # Processed password features
├── scripts/
│ ├── preprocessing/
│ │ ├── password_dataset_feature_engineering.py # Feature extraction script
│ ├── training/
│ │ ├── train_password_model.py # Model training script
│ │ ├── models_linear_regression.py # Custom linear regression implementation
├── main.py # Main application script
├── generate_password.py # Password generation script
├── infer.py # Password strength inference script
├── password_time_model.pkl # Trained model file
├── diagram.png # Dataset visualization
├── diagram_predicted.png # Model prediction visualization
├── requirements.txt # Project dependencies
├── README.md # Project documentation
├── .gitignore # Git ignore file
├── .gitattributes # Git attributes file
-
Clone the Repository:
git clone https://github.com/fx-xf/password-analyzer.git cd password-analyzer -
Create a Virtual Environment (recommended):
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
-
Prepare the Dataset:
-
Place the
rockyou.txtdataset indata/raw/. -
Run the preprocessing script to generate features:
python scripts/preprocessing/password_dataset_feature_engineering.py
-
-
Train the Model:
-
Run the training script to generate
password_time_model.pkl:python scripts/training/train_password_model.py
-
Run the main application:
python main.py- 0: Check Password Strength - Analyze a password's entropy and complexity using the trained model.
- 1: Generate Secure Password - Create a random, secure password with customizable options.
- 2: About Developer - View information about the developer.
- 3: Exit - Close the application.
-
Select option
0to check a password:Enter password to check: MyP@ssw0rd Password Analysis: MyP@ssw0rd Length: 10 Digits: 1 Lowercase letters: 6 Uppercase letters: 2 Special characters: 1 Actual entropy: 59.46 Complexity (actual): Medium Predicted entropy (model): 56.23 Complexity (model): Medium -
Select option
1to generate a password:Enter password length (default 16): 12 Use uppercase letters? (Y/n): Y Use digits? (Y/n): Y Use special characters? (Y/n): Y Your generated password: K7@mP#n9qL2x
Listed in requirements.txt:
pandasnumpyscikit-learnmatplotlibtqdmrichpyfigletcolorama
- diagram.png: Scatter plot of the password dataset with training and test data.
- diagram_predicted.png: Comparison of actual and predicted entropy values.
Contributions are welcome! Please:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Commit your changes (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Open a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
Developed by fx-xf. For questions or feedback, open an issue or contact me via GitHub.
Enjoy securing your passwords with the Password Strength Analyzer!