Skip to content

ShadowMarty/Encrypted-Chat-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secure Chat Application

A secure, encrypted chat application that allows users to communicate in private chat rooms with end-to-end encryption.

Features

  • 🔐 End-to-end encryption for all messages
  • 🔄 Unique chat codes for each conversation
  • 🌐 Multi-user chat support
  • 📊 Real-time participant list updates
  • 🎨 Color-coded console output for better readability
  • 🔍 Chat history display
  • 🔄 Automatic encryption key generation

Project Structure

  • gui.py - The main client application with GUI interface
  • server.py - The server application that manages chat rooms and connections
  • encrypt.c - The encryption/decryption tool that handles message encryption

Prerequisites

  • Python 3.6 or higher
  • C compiler (for building encrypt.c)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/secure-chat.git
cd secure-chat
  1. Build the encryption tool:
gcc encrypt.c -o encrypt
  1. Install Python dependencies: (Currently Only standard Library modules are used, this step can be skipped)
pip install -r requirements.txt

Running the Application

Starting the Server

  1. Open a terminal and navigate to the project directory
  2. Run the server:
python server.py

The server will start listening on localhost port 5000.

Starting the Client

  1. Open another terminal and navigate to the project directory
  2. Run the client:
python gui.py
  1. The client will prompt you to:
    • Enter a username
    • Generate a chat code (or enter an existing one to join a chat)
    • Enter a 6-digit numeric passcode for encryption

Usage

  1. When you first run the client, you'll be prompted to:

    • Enter your username
    • Generate a new chat code or enter an existing one
    • Enter a 6-digit numeric passcode
  2. To start a new chat:

    • Generate a new chat code
    • Share this code with other participants
    • Share the passcode with other participants
  3. To join an existing chat:

    • Enter the chat code provided by the chat creator
    • Enter the passcode provided by the chat creator

Security Features

  • All messages are encrypted using a custom 62-character base encoding
  • Each chat uses a unique encryption key based on a 6-digit passcode
  • Messages are encrypted before transmission and decrypted upon receipt
  • The encryption key is never transmitted over the network

Technical Details

Encryption Algorithm

The encryption uses a custom base62 encoding scheme:

  1. Each character is split into high and low 6-bit parts
  2. These parts are encoded using a shuffled 62-character alphabet
  3. The shuffling is based on a 6-digit numeric passcode
  4. Each chat uses a unique shuffled alphabet based on its passcode

Server Architecture

The server uses a multi-threaded architecture:

  • Each client connection runs in its own thread
  • Chat rooms are managed using chat codes
  • Participant lists are automatically updated when users join/leave
  • Messages are broadcast to all participants in the same chat

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Acknowledgments

  • Thanks to all contributors who have helped improve this project
  • Special thanks to the Python and C communities for their excellent documentation and support

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published