Skip to content

This C++ program implements a simple and secure login system with three primary functionalities: user login, user registration (sign-up), and password recovery (forgot password). The user data is stored in a file (loginData.txt) in a structured format.

Notifications You must be signed in to change notification settings

SagarBiswas-MultiHAT/secure-login-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Secure Login System

A basic C++ application providing a secure login system. Users can sign up, log in, and recover forgotten passwords. User data is securely stored in a file.

Features

  • Sign-Up: Allows new users to register by entering their username, email, and password.
  • Login: Authenticates existing users by checking their username and password.
  • Forgot Password: Helps users recover their forgotten password by verifying their username and email.
  • Data Storage: User details are stored in a file named loginData.txt.

How to Use

  1. Clone the repository or download the source code.
  2. Compile the code using a C++ compiler (e.g., g++).
    g++ -o secure_login_system secure_login_system.cpp
  3. Run the compiled program.
    ./secure_login_system
  4. Follow the menu prompts to sign up, log in, or recover a password.

Menu Options

  • 1 - Login: Enter your username and password to log in.
  • 2 - Sign-Up: Register as a new user by providing your username, email, and password.
  • 3 - Forgot Password: Recover your password by entering your registered username and email.
  • 4 - Exit: Exit the application.

File Format

User details are stored in loginData.txt in the following format:

username*email*password

Example

john_doe*john@example.com*securepassword123

Code Overview

#include <iostream>
#include <fstream>
using namespace std;

class temp {
    string userName, Email, password;
    string searchName, searchPass, searchEmail;
    fstream file;
public:
    void login();
    void signUP();
    void forgot();
} obj;

int main() {
    char choice;
    while (true) {
        cout << "\n\n\t\t..:: Secure Login System ::..";
        cout << "\n\n\t\t\t1- Login";
        cout << "\n\t\t\t2- Sign-Up";
        cout << "\n\t\t\t3- Forgot Password";
        cout << "\n\t\t\t4- Exit";
        cout << "\n\n\t..:: Enter Your Choice\t: ";
        cin >> choice;

        switch (choice) {
        case '1':
            cin.ignore();
            obj.login();
            break;
        case '2':
            cin.ignore();
            obj.signUP();
            break;
        case '3':
            cin.ignore();
            obj.forgot();
            break;
        case '4':
            return 0;
        default:
            cout << "Invalid Selection...!";
        }
    }
}

void temp::signUP() {
    // Sign-Up Implementation
}

void temp::login() {
    // Login Implementation
}

void temp::forgot() {
    // Forgot Password Implementation
}

Author

SagarBiswas-MultiHAT

About

This C++ program implements a simple and secure login system with three primary functionalities: user login, user registration (sign-up), and password recovery (forgot password). The user data is stored in a file (loginData.txt) in a structured format.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages