Skip to content

kavish0302/Secure-Chat-Application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” SafeChat - A Secure Messaging App Using Real Cryptography

Ever wondered how encrypted messaging actually works?
SafeChat is a secure terminal-based chat application that puts cryptographic theory into practical use, built as part of my Applied Cryptography Lab project.


πŸ’‘ Overview

SafeChat is a Python-based messaging system that lets users exchange encrypted messages using AES-256. It also includes secure user authentication using PBKDF2 with HMAC-SHA256 and a JSON-based user store.

This project was developed by Kavish Gulati under the guidance of Dr. Gururaj H L, for partial fulfillment of the Applied Cryptography Lab.


πŸ” Features

  • End-to-End AES-256 Encryption

    • Messages are encrypted with a user-defined key before being sent.
    • Uses CBC mode with PKCS7 padding for secure message blocks.
  • Secure User Authentication

    • Passwords are never stored in plaintext.
    • Implements PBKDF2 hashing with per-user salts.
  • Encrypted Logging

    • Messages are logged in both plaintext and encrypted formats for educational use.
    • The logs are securely deleted when the app is restarted or closed.
  • Modular Design

    • All cryptographic operations are abstracted into a utility module for easy understanding and reuse.

πŸ› οΈ Tech Stack

  • Language: Python 3
  • Encryption: AES-256 (CBC)
  • Hashing: PBKDF2-HMAC-SHA256
  • Data Storage: JSON
  • UI: Command-Line Interface (CLI)

πŸš€ How It Works

Download the requirements

pip install -r requirements.txt

1. Register / Login

Users register with a username and password. Passwords are hashed and salted using PBKDF2 and stored securely.

2. Start Server

Launch the server:

python server.py

3. Connect Clients

Run the client app and log in:

python client.py

Each message typed is encrypted on the sender's side and decrypted on the receiver's endβ€”using the same key derived from the login session.


πŸ“¦ Project Structure

β”œβ”€β”€ client.py           # Handles user input and message sending/receiving
β”œβ”€β”€ server.py           # Manages multiple client connections
β”œβ”€β”€ crypto_utils.py     # Encryption, decryption, and hashing functions
β”œβ”€β”€ message_logger.py   # Handles encrypted logging and deletion
β”œβ”€β”€ users.json          # Stores user credentials securely (hashed + salted)

🌱 Future Plans

  • Add a Tkinter or PyQt GUI
  • Integrate secure key exchange (e.g., Diffie-Hellman)
  • QR code-based login/authentication
  • TLS/SSL-based encrypted socket connections

πŸ™Œ Acknowledgments

Built with lots of late-night debugging and coffee by Kavish Gulati,
under the supervision of Dr. Gururaj H L.


πŸ“œ License

This project is open-source for learning purposes. Contributions and suggestions are welcome!


πŸ”— Let's Connect

Feel free to connect with me on LinkedIn or contribute to the repo!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages