Skip to content

BreachWatch securely checks if your password was leaked in a breach using the k-anonymity method—only part of the hashed password is sent, keeping it private.

Notifications You must be signed in to change notification settings

Sreekar-Reddy-D/breachwatch-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

breachwatch-backend


BreachWatch – Flask API

This is the backend API service for BreachWatch, a simple and secure app to check whether a password has been exposed in a known data breach using the HaveIBeenPwned (HIBP) API.


Tech Stack

  • Python 3.10+
  • Flask
  • Flask-CORS
  • Gunicorn (production server)
  • Hosted on Render

API Endpoints

POST /check_password

Checks whether the given password hash suffix has been found in known breaches.

Request JSON:

{
  "prefix": "5BAA6",
  "suffix": "1E4C9B93F3F0682250B6CF8331B7EE68FD8"
}

Response JSON:

{
  "pwned": true,
  "count": "6099453"
}

Setup Instructions

1. Clone and Install

git clone https://github.com/<your-username>/breachwatch-backend.git
cd breachwatch-backend
pip install -r requirements.txt

2. Run Locally

python app.py
# or for production:
gunicorn app:app --bind 0.0.0.0:10000

requirements.txt

flask
requests
gunicorn
flask-cors

Security Note

  • Passwords are hashed client-side using SHA1.
  • Only a 5-character prefix of the hash is sent to the backend.
  • This preserves user privacy by using HIBP’s k-anonymity model.

About

BreachWatch securely checks if your password was leaked in a breach using the k-anonymity method—only part of the hashed password is sent, keeping it private.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages