A peer-to-peer (P2P) secure chat application built using Python sockets with end-to-end encryption using **RSA + AES-GCM**.
This project allows multiple users connected to the same network (Wi-Fi/LAN) to communicate securely without a central server.
---
## 🚀 Features
- 🔐 End-to-End Encryption (RSA + AES-GCM)
- 📡 Peer-to-Peer Communication (No Server Required)
- ⚡ Fast TCP Socket Messaging
- 👤 Username-based Messaging
- 🔁 Automatic Reconnection Handling
- 🧵 Multi-threaded Client Handling
- 🛡 Secure Key Exchange (RSA OAEP)
---
## 🧠 How It Works
1. Each user generates an RSA key pair.
2. When connecting:
- Users exchange public keys.
- A secure AES session key is generated.
- AES key is encrypted using RSA.
3. Messages are encrypted using AES-GCM before sending.
4. Receiver decrypts messages securely.
---
## 📦 Requirements
Install dependencies:
```bash
pip install cryptographypython chat.pyYour name: Guhan
Peer IP: 192.168.1.5
Peer IP: 192.168.1.6
- All devices must be on the same Wi-Fi/LAN
- Firewall should allow port 7777
chat.py # Main application
README.md # Documentation
LICENSE # License file
- RSA (2048-bit) for key exchange
- AES-GCM (128-bit) for message encryption
- Unique nonce per message
- Protection against replay attacks
- Works only in local network (LAN/Wi-Fi)
- No message persistence (no database)
- Manual IP input required
Feel free to fork and improve this project!
Guhan Senthil