A secure, encrypted chat application that allows users to communicate in private chat rooms with end-to-end encryption.
- 🔐 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
gui.py- The main client application with GUI interfaceserver.py- The server application that manages chat rooms and connectionsencrypt.c- The encryption/decryption tool that handles message encryption
- Python 3.6 or higher
- C compiler (for building encrypt.c)
- Clone the repository:
git clone https://github.com/yourusername/secure-chat.git
cd secure-chat- Build the encryption tool:
gcc encrypt.c -o encrypt- Install Python dependencies: (Currently Only standard Library modules are used, this step can be skipped)
pip install -r requirements.txt- Open a terminal and navigate to the project directory
- Run the server:
python server.pyThe server will start listening on localhost port 5000.
- Open another terminal and navigate to the project directory
- Run the client:
python gui.py- 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
-
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
-
To start a new chat:
- Generate a new chat code
- Share this code with other participants
- Share the passcode with other participants
-
To join an existing chat:
- Enter the chat code provided by the chat creator
- Enter the passcode provided by the chat creator
- 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
The encryption uses a custom base62 encoding scheme:
- Each character is split into high and low 6-bit parts
- These parts are encoded using a shuffled 62-character alphabet
- The shuffling is based on a 6-digit numeric passcode
- Each chat uses a unique shuffled alphabet based on its passcode
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
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Thanks to all contributors who have helped improve this project
- Special thanks to the Python and C communities for their excellent documentation and support