Demo : Project Demo Link
An AI-powered, multi-layered password evaluation and generation system designed to identify vulnerabilities, improve password robustness, and assist users in creating secure yet memorable passwords. It integrates traditional security techniques, statistical analysis, and Generative AI for end-to-end password security enhancement.
It’s like having a personal password coach.
It’s a compliance & security enforcement tool.
The goal of this system is to analyze the strength of a password through multi-dimensional evaluation layers and provide intelligent suggestions to improve password security. By simulating different types of real-world attacks (e.g., brute force, social engineering, breached databases), it ensures each password undergoes rigorous scrutiny.
- Frontend: React.js
- Backend: Flask
- Authentication: JWT (JSON Web Tokens)
- Password Hashing & Security: bcrypt, Bloom filters
- Security Models & Logic: zxcvbn, Entropy calculations
- Explainability: SHAP (SHapley Additive exPlanations)
- Generative AI: Mistral LLM for intelligent feedback and password generation
- Data: Breached datasets like RockYou, LinkedIn leaks
This system evaluates passwords across Six key layers, each simulating a real-world attack vector or analysis dimension:
- Type: Brute Force Attack Simulation
- Approach: Checks the password against known leaked datasets like RockYou and LinkedIn dumps using Bloom Filters for fast lookup.
- Goal: Prevent the use of passwords that are already publicly exposed.
- Type: Social Engineering Attack Simulation
- Approach: Identifies passwords containing or resembling personal identifiable data (PII) such as names, DOBs, email fragments using fuzzy matching.
- Goal: Detect predictable or easily guessable patterns related to user identity.
- Type: Pure Brute Force Simulation
- Approach: Analyzes structure based on character types (uppercase, lowercase, digits, symbols), repetition patterns, keyboard adjacency, and dictionary patterns using zxcvbn.
- Goal: Evaluate complexity against generic brute-force attacks.
- Approach: Calculates Shannon entropy and uses combinatorial logic to estimate crack time against common attack strategies.
- Goal: Quantify randomness and evaluate resilience to password cracking tools.
- Approach:
- Uses Mistral LLM to generate strong passwords tailored to security requirements.
- Interactively updates password based on user queries (e.g., "make it easier to remember", "add a special character", "use a word I like").
- Goal: Achieve a balance between security, unpredictability, and user memorability.
Each layer provides:
- Scoring
- Risk Explanation using SHAP
- Actionable Suggestions from LLM
The system returns an aggregated strength score, visual feedback, and intelligent suggestions that adapt based on specific vulnerabilities detected in each layer.
- Users can query the LLM to generate passwords that:
- Avoid banned patterns
- Match complexity standards
- Are easier to remember while maintaining entropy
- Includes interactive update system that lets users modify generated passwords (e.g., change structure, add memorable phrases).
- Users can enroll audio as a password
- System verifies the speaker and audio password
- Detects deepfake audio
| Feature | Description |
|---|---|
| Password Strength Analysis | Layered evaluation using breached data, PII check, zxcvbn, entropy, and LLM |
| Leak Detection | Breach dataset lookup with Bloom filters |
| Pattern Analysis | Detects predictable or weak sequences |
| Entropy Check | Measures cryptographic randomness |
| SHAP Explainability | Interprets feature impact for each password |
| Dictionary Matching | Compares with common words and passwords |
| PII Detection | Detects use of name, email, DOB patterns |
| Strong Password Generator | GenAI-driven custom password creation |
| Crack Time Estimation | Estimates how long a password would take to crack |
| Bulk Password Validation | For enterprise-wide audits |
| Password Expiration Alerts | Notifies users of outdated passwords |
| Password History Check | Prevents reuse of recent passwords |
| Admin Control Panel | Configure organizational security policies |
| Enterprise Password Uniqueness | Ensures password uniqueness across teams |
| Audio-based password workflows | Audio based password verification with deepfake analysis |
| AI Feedback | Explains weaknesses and gives personalized suggestions |
- Artificial Intelligence (AI)
- Machine Learning
- Bloom Filters
- zxcvbn Password Analysis
- Large Language Models (LLM) – Mistral
- SHAP (Explainability)
- bcrypt for Hashing
- JWT (JSON Web Tokens)
- React.js (Frontend)
- Flask (Backend)
- SpeechBrain Library (Speaker verification)
- AssemblyAI API (Audio Transcription)
- CNN & BiLSTM (Deepfake Detection)
- Developers: Integrate into login systems or password checkers.
- Enterprises: Conduct audits, enforce password policies, and detect weak credentials.
- Users: Get real-time feedback and generate secure, personalized passwords.
- Security Auditors: Perform breach checks and pattern evaluations at scale.
Password-Strength-Analysis-Using-GenAI/
│
├── Backend/
│ ├── app.py
│ ├── ban_pattern_detection/
│ │ ├── app.py
│ │ ├── add_ban_words.py
│ │ └── ban_words_collection/
│ │ └── banned_words_1.pkl ... banned_words_6.pkl
│ │
│ ├── composition_check/
│ │ ├── app.py
│ │ ├── models/
│ │ │ ├── preprocessor.pkl
│ │ │ └── random_forest_model.pkl
│ │ ├── data_generation (Data prepared for training model (Rockyou-weak password data))
│ │ │ └── app.py
│ │ └── train_models
│ │ └── app.py
│ │
│ ├── crack_time_estimator/
│ │ ├── app.py
│ │ ├── password.txt
│ │ └── weak_password.txt
│ │
│ ├── deepfake_audio_detection/
│ │ ├── app.py
│ │ ├── my_model.h5
│ │ └── Test/
│ │ ├── fake_audio.mp3
│ │ ├── OriginalAudio.wav
│ │ └── OriginalAudio-2.wav
│ │
│ ├── leaked_password_detection/
│ │ ├── app.py
│ │ └── bloom_filters/
│ │ ├── bloom_00.pkl ... bloom_ff.pkl
│ │ └── ReadMe.md
│ │
│ ├── PII_detector/
│ │ └── app.py
│ │
│ ├── strong_password_generator/
│ │ ├── app_gemini.py
│ │ └── app_mistral.py
│ │
│ └── user_based_password/
│ ├── app_gemini.py
│ └── app_mistral.py
│
│
├── Frontend/
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ ├── favicon.ico
│ │ └── ... (icons, manifest)
│ └── src/
│ ├── App.js
│ ├── index.js
│ ├── components/
│ │ ├── AdminControlPanel.jsx
│ │ ├── AuthModal.jsx
│ │ ├── BreachDetection.jsx
│ │ ├── ... (other components)
│ ├── css/
│ │ ├── Dashboard.css
│ │ ├── ... (other styles)
│ ├── images/
│ │ └── logo.png
│ ├── pages/
│ │ ├── Dashboard.jsx
│ │ ├── PasswordAnalysis.jsx
│ │ ├── ... (other pages)
│ └── styles/
│ ├── BreachDetection.css
│ ├── ... (other feature styles)
│
├── LICENSE
├── README.md
Follow these steps to get both backend and frontend running locally. Commands below assume you're on Windows using bash.exe (Git Bash / WSL). Adjust package manager commands for your OS as needed.
- open terminal and type
git clone https://github.com/ovuiproduction/Password-Strength-Analyzer-Using-GenAI- Python 3.10+ (recommend 3.11)
- Node.js 18+ and npm or yarn
- MongoDB (local or managed)
- ffmpeg (for audio processing)
- Git
If you plan to run deepfake/audio features or use certain ML models, you may also need a working C/C++ build toolchain (MSVC on Windows or build-essential on Linux) and sufficient RAM/GPU support for model inference.
- Open a bash shell in the
Backend/folder.
cd Backend
# create virtual environment (venv)
python -m venv .venv
- Install Python dependencies from
requirements.txt(file included inBackend/):
pip install --upgrade pip
pip install -r requirements.txtIf you don't have requirements.txt, install these core packages (approx):
pip install flask flask-cors python-dotenv pymongo bcrypt flask-jwt-extended pandas numpy scikit-learn xgboost joblib shap zxcvbn-python librosa pydub tensorflow torch soundfileNote: some packages (e.g., librosa, pydub, ffmpeg, SpeechBrain) require system libraries. Install ffmpeg separately (see below).
- Rename Backend/.env.example to Backend/.env
- Fill that with actual keys
- Rename Frontend/.env.example to Frontend/.env
- Fill that with actual keys
- From the project root open a bash shell and change to
Frontend/:
cd Frontend
npm install
# or: yarn install- Start the frontend dev server:
npm start
# or: yarn startThe app will typically run at http://localhost:3000.
Prerequisites : Open each folder in backend and follow the instructions given in each file to run backend as expected
# if app.py has an app.run guard you can run:
python app.py
API endpoints are available at http://localhost:5000 by default.
This project uses a number of Python and system dependencies. Key packages:
- Flask, flask-cors, python-dotenv
- pymongo
- bcrypt
- flask-jwt-extended
- pandas, numpy
- scikit-learn, xgboost, joblib
- shap
- zxcvbn-python
- librosa, soundfile, pydub, ffmpeg (audio)
- tensorflow and/or torch (models)
- SpeechBrain (speaker verification)
- jsPDF, recharts, axios, react, react-router (frontend packages in
package.json)
John the Ripper (JTR) provides more realistic crack time estimations. On Windows you have two recommended options:
- Option A — Use WSL (recommended):
# in WSL (Ubuntu):
sudo apt update
sudo apt install -y john
# verify
john --version- Option B — Prebuilt Windows binaries (jumbo):
- Download a precompiled
john(Jumbo) from Openwall or a trusted release page. - Unzip and add the
johnexecutable directory to your PATH or setJTR_PATHin.env.
- Download a precompiled
When JTR_PATH is provided, the backend will call the binary for crack-time estimation where implemented.
- Create or obtain an API key for the Gemini (Google Generative) API following Google's docs.
- Add the key to your
.envasGEMINI_API_KEY. - Example usage in backend code (
Backend/strong_password_generator/app_gemini.py):
import os
from google.generativeai import client
API_KEY = os.getenv("GEMINI_API_KEY")
client.configure(api_key=API_KEY)
# then call the client to create completions- Install
ffmpegand ensureFFMPEG_PATHorffmpegis available on PATH. - Install
librosa,soundfile, andpydubinto the Python environment. - For speaker verification use
SpeechBrainand any pretrained models. - For
SpeechBrainhugging face authentication required
- Install MongoDB
- Create database with name
password_security - update backend/.env
- Start MongoDB
- Activate backend venv and install requirements
- Set
.envvariables - Start backend:
python Backend/app.pyorpython app.py - Start frontend:
cd Frontend && npm start
- If audio packages fail to install, ensure
ffmpegand system build tools are installed. - If a library throws missing header errors, install your OS C build tools (e.g.,
build-essentialon Debian/Ubuntu or MSVC on Windows). - For permission problems on Windows, try running from WSL or an elevated shell.
This project is licensed under the MIT License