Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Typing SVG

Repo Size Last Commit Issues Stars License

๐Ÿ” A brute-force-resistant authentication engine โ€” console-grade security, browser-grade convenience.



๐Ÿ“š Table of Contents

# Section
1 ๐Ÿ“Œ Project Overview
2 ๐ŸŽฌ Preview
3 โœจ Features
4 ๐Ÿ”’ Lockout System Deep Dive
5 ๐Ÿ—๏ธ Architecture
6 ๐Ÿ› ๏ธ Tech Stack
7 โš™๏ธ How It Works
8 โ–ถ๏ธ Installation & Usage
9 ๐Ÿ“‚ Project Structure
10 ๐Ÿ›ก๏ธ Security Notes
11 ๐Ÿ—บ๏ธ Roadmap
12 ๐Ÿ‘ค Author
13 ๐Ÿ“„ License

๐Ÿ“Œ Project Overview

This project implements a complete authentication flow โ€” user registration, credential verification, and brute-force protection โ€” available in two flavors:

๐Ÿ’ป C++ Console App โ€” credentials persisted to external files (users.txt, lockout.txt) ๐ŸŒ Web Demo ("Vault Panel") โ€” same logic, running entirely client-side via localStorage

flowchart LR
    A([๐Ÿ‘ค User Attempts Login]) --> B{Account Locked?}
    B -->|Yes| C[โณ Show Countdown Timer]
    C --> B
    B -->|No| D{Credentials Valid?}
    D -->|โœ… Yes| E([๐Ÿ”“ Access Granted])
    D -->|โŒ No| F[โž• Increment Fail Counter]
    F --> G{3 Consecutive Fails?}
    G -->|No| A
    G -->|Yes| H([๐Ÿ”’ Lock Account for 60s])
    H --> C
Loading

๐ŸŽฌ Preview

๐Ÿ–ฅ๏ธ Vault Panel โ€” Login ๐Ÿšจ Lockout Countdown

(Swap these placeholders for real screenshots or a screen-recorded GIF of the Vault Panel in /assets)


โœจ Features

๐Ÿ”‘ Core Features

  • ๐Ÿ“ User registration with duplicate-username detection
  • ๐Ÿ” Secure login with credential verification
  • โœ… Input validation (empty fields, min password length)
  • ๐Ÿง‚ Credentials stored with basic password encoding
  • ๐Ÿ–ฅ๏ธ Clean, menu-driven console interface

๐Ÿ”’ Account Lockout System

  • ๐Ÿ“Š Tracks failed login attempts per user
  • โ›” Auto-locks for 60 seconds after 3 consecutive fails
  • โฑ๏ธ Live countdown display while locked
  • โ™ป๏ธ Auto-unlocks & resets attempt counter after expiry
  • ๐Ÿ’พ Lockout state persists across sessions

๐ŸŒ Web Demo โ€” "Vault Panel"

  • ๐Ÿ–ค Secure-terminal-inspired UI for Login / Register
  • ๐Ÿ”ด Real-time failed-attempt LED indicator
  • โณ Live lockout countdown timer, client-side
  • ๐Ÿ” Identical 3-attempt / 60-second lockout logic as the C++ core โ€” no server required

๐Ÿ”’ Lockout System Deep Dive

๐Ÿ” Click to expand โ€” Lockout state machine
stateDiagram-v2
    [*] --> Unlocked
    Unlocked --> Unlocked: Failed attempt (1st / 2nd)
    Unlocked --> Locked: 3rd consecutive failed attempt
    Locked --> Locked: Login attempt blocked, countdown shown
    Locked --> Unlocked: 60s timer expires, counter resets
    Unlocked --> [*]: Successful login
Loading
State Trigger Behavior
๐ŸŸข Unlocked Default / after timer expiry Login attempts allowed, counter tracked
๐ŸŸก Warning 1โ€“2 failed attempts User notified of remaining attempts
๐Ÿ”ด Locked 3rd consecutive failure All logins blocked, 60s countdown starts
๐Ÿ”“ Reset Successful login or timer expiry Fail counter reset to 0
๐Ÿ’ป Click to expand โ€” C++ lockout logic sample
bool attemptLogin(User &user, const string &password) {
    if (isLocked(user)) {
        cout << "๐Ÿ”’ Account locked. Try again in "
             << remainingLockTime(user) << "s\n";
        return false;
    }

    if (verifyPassword(user, password)) {
        user.failedAttempts = 0;   // โœ… reset on success
        return true;
    }

    user.failedAttempts++;
    if (user.failedAttempts >= 3) {
        user.lockUntil = time(nullptr) + 60; // ๐Ÿ”’ lock for 60s
        cout << "๐Ÿšจ Too many failed attempts. Account locked for 60s.\n";
    }
    return false;
}

๐Ÿ—๏ธ Architecture

graph TD
    subgraph "๐Ÿ’ป C++ Console App"
        A1[Auth_System.cpp] --> A2[Register / Login Menu]
        A2 --> A3[Credential Validator]
        A3 --> A4[Lockout Manager]
        A4 --> A5[(users.txt / lockout.txt)]
    end

    subgraph "๐ŸŒ Web Demo - Vault Panel"
        B1[index.html] --> B2[Login / Register UI]
        B2 --> B3[Credential Validator - JS]
        B3 --> B4[Lockout Manager - JS]
        B4 --> B5[(Browser localStorage)]
    end

    A4 -.identical 3-attempt / 60s logic.- B4
Loading

๐Ÿ› ๏ธ Tech Stack

Layer Technology
๐ŸŽฎ Core Logic C++ โ€” fstream, structs, maps, ctime
๐Ÿ’ป Console App C++
๐ŸŒ Web Demo HTML5, CSS3, Vanilla JavaScript
๐Ÿ—„๏ธ Storage (C++) External files โ€” users.txt, lockout.txt
๐Ÿ—„๏ธ Storage (Web) Browser localStorage
๐Ÿš€ Hosting GitHub Pages

โš™๏ธ How It Works

Step Description
1๏ธโƒฃ Registration โ€” username & password validated, then securely stored
2๏ธโƒฃ Login โ€” system checks for an active lockout before verifying credentials
3๏ธโƒฃ Lockout Logic โ€” each failed attempt increments a counter; on the 3rd consecutive failure, the account locks for 60 seconds and further attempts are blocked until the timer expires

โ–ถ๏ธ Installation & Usage

๐Ÿ’ป C++ Console Version

g++ Auth_System.cpp -o Auth_System
./Auth_System

Follow the on-screen menu to Register, Login, or Exit.

๐ŸŒ Web Demo

No installation needed โ€” try it live:

Or run locally:

git clone https://github.com/ayeshajavid91-star/Secure-Auth-System.git
cd Secure-Auth-System

Then open index.html in your browser.


๐Ÿ“‚ Project Structure

Secure-Auth-System/
โ”‚
โ”œโ”€โ”€ ๐Ÿ’ป Auth_System.cpp     # C++ console application
โ”œโ”€โ”€ ๐ŸŒ index.html          # Web demo (Vault Panel)
โ”œโ”€โ”€ ๐ŸŽจ style.css            # Vault Panel styling (if separated)
โ”œโ”€โ”€ โš™๏ธ script.js            # Login / lockout logic (if separated)
โ””โ”€โ”€ ๐Ÿ“˜ README.md            # You are here

๐Ÿ›ก๏ธ Security Notes

โš ๏ธ This project is built for learning and demonstration purposes. It is not intended as a production-grade auth system.

  • ๐Ÿง‚ Passwords use basic encoding, not a cryptographic hashing algorithm like bcrypt/Argon2
  • ๐Ÿ—„๏ธ The C++ version stores data in plain external files, not an encrypted database
  • ๐ŸŒ The web demo's localStorage is client-side only and not a substitute for real server-side auth
  • โœ… For production use, pair this logic with salted password hashing, HTTPS, and server-side session management

๐Ÿ—บ๏ธ Roadmap

  • Registration + login with validation
  • 3-attempt / 60-second lockout mechanism
  • Web demo with live countdown & LED indicators
  • Password hashing (bcrypt-style) ๐Ÿ”
  • Two-factor authentication (2FA) ๐Ÿ“ฒ
  • Admin dashboard for account management ๐Ÿ› ๏ธ
  • Configurable lockout thresholds โš™๏ธ

๐Ÿท๏ธ Suggested GitHub Topics

cpp
authentication-system
login-system
secure-login
file-handling
password-security
lockout-mechanism
javascript
html-css-javascript
web-app
console-application
programming-project

๐Ÿ‘ค Author

Developed by Ayesha Javid


๐Ÿ“„ License

All Rights Reserved.

This project and its source code are the intellectual property of the author. No part of this repository โ€” including the code, design, or documentation โ€” may be copied, modified, distributed, used, or reproduced in any form without the explicit written permission of the author.

ยฉ 2026 Ayesha Javid. Unauthorized use is strictly prohibited.

For permissions or licensing inquiries, contact: ayeshajavid91@gmail.com


โญ If you like this project, consider giving it a star! โญ

About

๐Ÿ” A secure authentication system with registration, login, and a 3-attempt lockout mechanism โ€” built in C++ with an interactive web demo (Vault Panel). ๐Ÿ›ก๏ธ

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages