Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secure Login System

A minimal secure authentication demo built with Flask, SQLite, and bcrypt.

Overview

This project demonstrates a simple secure login flow with:

  • user registration
  • hashed password storage with bcrypt
  • login verification
  • session-based access control using Flask sessions
  • secure cookie defaults (HttpOnly and SameSite=Lax)

Files

  • app.py - Flask web application with routes for registration, login, dashboard, and logout.
  • auth_backend.py - Authentication backend that handles user registration and login verification using SQLite and bcrypt.
  • init_db.py - Database initialization script that creates the auth_system.db file and the users table.

Requirements

  • Python 3.10+ (recommendation)
  • Flask
  • bcrypt

Setup

  1. Create and activate a virtual environment (recommended):
python -m venv venv
.\venv\Scripts\Activate.ps1
  1. Install dependencies:
pip install flask bcrypt
  1. Initialize the database:
python init_db.py

Run

Start the application:

python app.py

Then open http://127.0.0.1:5000 in your browser.

Notes

  • The app.secret_key in app.py is hard-coded for demonstration only. In production, replace it with a strong random secret and store it in an environment variable.
  • The database file is auth_system.db.
  • Passwords are securely hashed with bcrypt before storage.

About

A secure login web app.User registration and login using hashed passwords (bcrypt or Argon2).Basic input validation and protection from SQL injection.Session management with logout feature

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages