๐ A brute-force-resistant authentication engine โ console-grade security, browser-grade convenience.
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 vialocalStorage
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
| ๐ฅ๏ธ Vault Panel โ Login | ๐จ Lockout Countdown |
|---|---|
![]() |
![]() |
(Swap these placeholders for real screenshots or a screen-recorded GIF of the Vault Panel in /assets)
|
|
|
|
๐ 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
| 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;
}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
| 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 |
| 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 |
g++ Auth_System.cpp -o Auth_System
./Auth_SystemFollow the on-screen menu to Register, Login, or Exit.
No installation needed โ try it live:
Or run locally:
git clone https://github.com/ayeshajavid91-star/Secure-Auth-System.git
cd Secure-Auth-SystemThen open index.html in your browser.
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
โ ๏ธ 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
localStorageis 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
- 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 โ๏ธ
cpp
authentication-system
login-system
secure-login
file-handling
password-security
lockout-mechanism
javascript
html-css-javascript
web-app
console-application
programming-project
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

