Skip to content

PyAuth System is a simple and secure user authentication system built with Python, featuring both a command-line interface and a modern GUI using customtkinter. The project includes user registration, login, password hashing for security, password change functionality, and JSON-based data storage.

License

Notifications You must be signed in to change notification settings

asnaassalam/py-auth-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔐 Py Auth System

A step-by-step evolving project that begins as a simple CLI-based login/register app using Python dictionaries and gradually transforms into a secure, GUI-based user authentication system using file storage and password hashing.

🚀 Project Phases & Features

✅ Phase 1: CLI (In-Memory Dictionary)

  • Register new users
  • Login existing users
  • View user profile
  • Change/reset Password
  • Basic CLI interface

✅ Phase 2: File-Based Storage

  • Save user data in JSON file
  • Load data at startup
  • Prevent duplicate registrations

✅ Phase 3: Password Hashing

  • Secure password storage using hashlib
  • Password verification during login

✅ Phase 4: Input Validation

  • Validate username
  • Enforce password strength
  • Meaningful error messages

✅ Phase 5: GUI with customtkinter

  • Register/Login screens with modern UI
  • Message boxes for success/failure feedback
  • Password masking
  • Separate windows for Register, Login, and Welcome
  • Navigation between Register and Login screens
  • Change/reset password
  • Logout functionality

🛠️ Tech Stack

  • Python 3.x
  • hashlib – for password hashing
  • json – for user data persistence
  • customtkinter – for modern and themed GUI components

📁 Folder Structure

py-auth-system/
├── cli-version/              
│   └── main.py              # CLI-based logic
│
├── gui-version/
│   ├── register.py          # GUI Register window
│   ├── login.py             # GUI Login window
│   └── welcome.py           # GUI Welcome window after login
│
├── UI-Screenshots/          # UI previews
│   ├── login_window.png
│   ├── register_window.png
│   ├── reset_password.png
│   └── welcome_window.png
│
├── LICENSE                  # MIT License
├── users.json               # Shared user data file
└── README.md                # Project overview

▶️ How to Run

💻 CLI Version

  1. Navigate to the cli-version folder:
    cd cli-version
    python main.py

🪟 GUI Version

🛑 Requires customtkinter. Install it first:

pip install customtkinter
  1. Navigate to the gui-version folder:
    cd gui-version
    python register.py

🔄 Users can switch between Register and Login windows using clickable links.
✅ On successful login, a Welcome window will appear with a Reset Password and Logout button.

✅ Best Practices Followed

  • Passwords are hashed before storing
  • Plaintext passwords are never saved
  • Includes input validation and error handling
  • Clear separation between CLI and GUI components
  • GUI code uses modular window design

📌 Notes

  • The users.json file stores hashed passwords only. No plaintext passwords are stored.
  • For demo/testing, use this default test account:
    • Username: demo_user
    • Password: Demo@123

🧠 Concepts Covered

  • File Handling
  • Password Hashing & Security
  • JSON-based Data Persistence
  • GUI Development with customtkinter
  • Modular Python Code

📄 License

This project is licensed under the MIT License.

✍️ Author

Asna Assalam

This project was built as part of my self-learning journey to apply and strengthen my understanding of Python through hands-on practice.

About

PyAuth System is a simple and secure user authentication system built with Python, featuring both a command-line interface and a modern GUI using customtkinter. The project includes user registration, login, password hashing for security, password change functionality, and JSON-based data storage.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages