How saur-deshmukh/hackohire-hashhackers works
1. Overall shape
- FortiPhrase is a local, offline password-security platform split into a Next.js frontend and a set of Python/Flask backend services.
- The frontend orchestrates user interaction, while backend services handle password analysis, passphrase generation, crack-time estimation, bulk processing, and PII detection.
2. Frontend boundary
- Frontend/app/* defines the main user-facing routes: analyzer, bulk analysis, bulk PII scanning, and passphrase generation.
- The UI is built from reusable components in Frontend/components/* and shared hooks/utils in Frontend/hooks and Frontend/lib.
- Frontend/lib/mock-api.ts and Frontend/lib/api-utils.ts suggest the frontend is wired to call local backend APIs, with mock/fallback behavior for development.
3. Backend service decomposition
- The backend is not a single monolith; it is split into multiple Flask entrypoints:
- analyser.py — single-password strength analysis
- bulk.py — bulk password analysis
- bulk_pii.py — bulk password analysis with PII matching
- passphrase.py — passphrase generation
- time_to_crack.py — crack-time estimation
- insights.py — reports/insights
- Each service is exposed on its own localhost port, which matters for the architecture diagram because the frontend likely talks to multiple local endpoints rather than one API gateway.
4. Core analysis pipeline
- Password evaluation is driven by a Decision Tree Regressor model trained on 15 engineered features.
- The feature set includes length, character-class counts, repeated characters, consecutive sequences, and common patterns like keyboard/number/alpha sequences.
- The model artifacts live under Model/ (sample_model.joblib plus preprocessing/data notebooks and sample datasets), indicating an offline ML inference path at runtime.
5. Time-to-crack subsystem
- time_to_crack.py provides a distinct computational path from the ML strength score.
- The README indicates three crack models: dictionary, rainbow table, and brute force.
- In the diagram, this should be shown as a sibling capability to strength scoring, not just a post-processing step, because it produces independent risk estimates.
6. Passphrase generation subsystem
- passphrase.py generates secure passphrases from user-provided keywords.
- The README says it uses local AI via Ollama + LLaMA3, so this service depends on a locally running model server rather than a cloud API.
- This is the main external runtime dependency in the system and should be drawn outside the app boundary.
7. Bulk analysis and report flow
- bulk.py and bulk_pii.py process CSV-style inputs, analyze many passwords in one run, and produce outputs in Backend/outputs/.
- The repository includes Backend/input_file.csv and Backend/outputs/output_input_file.csv, indicating a file-based batch workflow rather than purely in-memory API calls.
- This is important for the architecture diagram: batch inputs enter via uploaded or local CSV files, are processed server-side, and results are written back as downloadable/generated output files.
8. PII detection subsystem
- pii_detector.py and the datasets in Backend/datasets/ support detecting sensitive information embedded in passwords.
- The datasets include Indian male/female/common names and a personal-information dataset, which suggests the PII matcher is tuned toward name-based or personal-data leakage checks.
- This subsystem is specific to the bulk PII route and should be shown as a data enrichment/validation stage in the batch pipeline.
9. Shared backend utilities and data assets
- Backend/utils.py likely contains shared feature extraction, scoring helpers, and text-processing logic used across services.
- Backend/bulk_passwords.csv, Backend/datasets/*.csv, and Backend/datasets/datasets.xlsx act as supporting reference data rather than primary application state.
- The Model/data/*.gzip files and notebooks in Model/ show an offline training/prep pipeline that is separate from runtime inference.
10. Runtime and deployment model
- The system is intended to run entirely locally: frontend in Next.js, multiple Flask processes, and a local Ollama model server.
- There is no indication of cloud storage or remote auth; privacy is a core architectural boundary, with no password data leaving the machine.
- For a diagram, the key external nodes are the user, the browser-based frontend, the local Flask services, the local ML model artifacts, and the Ollama/LLaMA3 runtime.
11. What to emphasize in an architecture diagram
- Show the frontend as a single presentation layer that fans out to several specialized backend services.
- Show the backend services sharing local datasets, ML artifacts, and utility modules.
- Show file-based batch processing and output generation as a separate path from interactive single-password analysis.
- Show Ollama/LLaMA3 as the only major external runtime dependency, but still local/offline.
12. Big-picture data flow
- User enters a password or uploads a CSV in the frontend.
- The frontend calls the relevant Flask service.
- The service extracts features, runs ML/rule-based checks, optionally queries local LLM support for suggestions, and returns strength/crack-time/PII findings.
- For bulk flows, results are also persisted to an output CSV for download or review.
Main entry points: lib API Helpers · app Next.js UI · bulk_pii.py Bulk PII · components UI Kit
Components 22
Frontend
Next.js presentation layer and client orchestration
- Next.js UI · Browser-facing app that routes users to analysis workflows
Frontend/app - Landing · Entry page and overall navigation
Frontend/app/page.tsx - Analyze · Single-password analysis interface
Frontend/app/analyze/page.tsx - Bulk · Batch password analysis interface
Frontend/app/bulk/page.tsx - Bulk PII · Batch analysis with PII checks
Frontend/app/bulk-pii/page.tsx - Passphrase · Passphrase generation interface
Frontend/app/passphrase/page.tsx - UI Kit · Reusable cards, meters, sections, and controls
Frontend/components - API Helpers · Local API wiring and mock/fallback behavior
Frontend/lib
Backend
Local Flask services for analysis and generation
- Analyzer · Single-password strength analysis endpoint
Backend/analyser.py - Bulk Analyze · CSV-style batch password processing
Backend/bulk.py - Bulk PII · Batch analysis plus PII matching
Backend/bulk_pii.py - Passphrase API · Generates secure passphrases from keywords
Backend/passphrase.py - Crack Time · Estimates dictionary, rainbow-table, and brute-force risk
Backend/time_to_crack.py - Insights · Produces reports and summary insights
Backend/insights.py - Shared Utils · Common feature extraction and scoring helpers
Backend/utils.py - PII Detector · Name and personal-data matching logic
Backend/pii_detector.py - Reference Data · CSV/XLSX datasets used for bulk and PII checks
Backend/datasets - Batch Files · Input and generated CSV batch artifacts
Backend/input_file.csv
Model
Offline ML artifacts and training prep
- ML Artifacts · Trained regressor, features, and prep data
Model/sample_model.joblib - Prep Pipeline · Data cleaning, feature engineering, and pipeline notebooks
Model/04_make_pipeline.ipynb
Local Runtime
External local dependency for passphrase generation
- Ollama + LLaMA3 · Local model server used for passphrase generation
Other components
- User · Enters passwords, uploads CSVs, and reviews results
Connections 34
- User → Next.js UI: uses · User interacts through the browser UI
- Next.js UI → Landing: navigates · Entry and overview routing
- Next.js UI → Analyze: routes · Single-password workflow
- Next.js UI → Bulk: routes · Batch analysis workflow
- Next.js UI → Bulk PII: routes · Batch PII workflow
- Next.js UI → Passphrase: routes · Passphrase workflow
- Analyze → API Helpers: calls · Front-end API access
- Bulk → API Helpers: calls · Front-end API access
- Bulk PII → API Helpers: calls · Front-end API access
- Passphrase → API Helpers: calls · Front-end API access
- API Helpers → Analyzer: requests · Interactive password scoring
- API Helpers → Bulk Analyze: requests · Bulk password scoring
- API Helpers → Bulk PII: requests · Bulk scoring with PII enrichment
- API Helpers → Passphrase API: requests · Passphrase generation
- API Helpers → Crack Time: requests · Time-to-crack estimation
- API Helpers → Insights: requests · Summary/report generation
- Analyzer → Shared Utils: uses · Shared feature extraction and scoring
- Bulk Analyze → Shared Utils: uses · Shared batch processing logic
- Bulk PII → Shared Utils: uses · Shared feature extraction and scoring
- Bulk PII → PII Detector: uses · Detects embedded personal data
- PII Detector → Reference Data: reads · Name and personal-information datasets
- Bulk Analyze → Batch Files: reads/writes · Consumes input CSV and emits output CSV
- Bulk PII → Batch Files: reads/writes · Consumes batch input and emits analyzed output
- Analyzer → ML Artifacts: loads · Offline regressor inference
- Bulk Analyze → ML Artifacts: loads · Offline regressor inference
- Bulk PII → ML Artifacts: loads · Offline regressor inference
- Crack Time → Shared Utils: uses · Shared password parsing helpers
- Passphrase API → Ollama + LLaMA3: depends on · Local LLM-backed generation
- ML Artifacts → Prep Pipeline: derived from · Trained from cleaned and engineered data
- Landing → UI Kit: composes · Shared presentation components
- Analyze → UI Kit: composes · Shared presentation components
- Bulk → UI Kit: composes · Shared presentation components
- Bulk PII → UI Kit: composes · Shared presentation components
- Passphrase → UI Kit: composes · Shared presentation components