Metadata-Version: 2.4
Name: echat
Version: 0.1.0
Summary: End-to-end encrypted terminal chat using Diffie-Hellman key exchange and AES encryption
Author-email: Your Name <your@email.com>
License: MIT
Project-URL: Homepage, https://github.com/yourusername/echat
Project-URL: Repository, https://github.com/yourusername/echat
Project-URL: Issues, https://github.com/yourusername/echat/issues
Keywords: chat,encryption,terminal,networking,security,diffie-hellman,aes
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: cryptography>=41.0.0

# echat - Encrypted P2P Terminal Chat

A secure, end-to-end encrypted **peer-to-peer** chat application for your terminal. Built with Python using Diffie-Hellman key exchange and AES-256 encryption.

## Features

- 🔗 **True P2P Architecture** - No central server, connect directly to peers
- 🔐 **Diffie-Hellman Key Exchange** - Secure key agreement without sharing secrets
- 🔒 **AES-256 Encryption** - Military-grade encryption using Fernet
- 🌐 **Network Support** - Works over local networks (LAN)
- 💬 **Full-Duplex** - Send and receive messages simultaneously
- 🖥️ **Terminal-Based** - No GUI needed, works in any terminal
- 📝 **Connection Requests** - Accept or reject incoming connections

## Installation

```bash
git clone https://github.com/manikanta-adupa/EncryptedTerminalChat.git
cd echat
pip install -e .
```

## Usage

### Start echat

Both users run the same command:

```bash
echat
```

### What You'll See

```
==================================================
  echat - Encrypted P2P Terminal Chat
==================================================

  Your IP: 192.168.1.100
  Listening on port: 9999

  Share your IP with others to let them connect.
==================================================

Options:
  1. Connect to a peer (enter their IP)
  2. Wait for incoming connections
  3. Exit

Enter peer IP to connect, or press Enter to wait:
```

### Connecting to a Peer

**User A (initiator):**
```
Enter peer IP to connect, or press Enter to wait: 192.168.1.101
Connecting to 192.168.1.101:9999...
Waiting for peer to accept...
Connection accepted!
Establishing secure connection...
Secure connection established!
==================================================
  You can now chat securely. Type 'exit' to quit.
==================================================
```

**User B (receiver):**
```
==================================================
  Incoming connection from 192.168.1.100
==================================================
Accept connection? (y/n): y
Establishing secure connection...
Secure connection established!
==================================================
  You can now chat securely. Type 'exit' to quit.
==================================================
```

### Custom Port

```bash
echat -p 8888
```

## How It Works

```
┌─────────────┐                    ┌─────────────┐
│   User A    │                    │   User B    │
│             │                    │             │
│  Listening  │   Connection Req   │  Listening  │
│  on :9999   │◄───────────────────│  on :9999   │
│             │                    │             │
│             │   Accept? (y/n)    │             │
│             │──────────────────►│             │
│             │                    │             │
│             │   Key Exchange     │             │
│             │◄──────────────────►│             │
│             │                    │             │
│             │  Encrypted Chat    │             │
│             │◄══════════════════►│             │
└─────────────┘                    └─────────────┘
```

1. **Both users start echat** - Each listens for incoming connections
2. **One user connects** - Enters the other's IP address
3. **Accept/Reject** - Receiver chooses to accept or reject
4. **Key Exchange** - Diffie-Hellman establishes shared secret
5. **Secure Chat** - All messages encrypted with AES-256

## Security

- ✅ Private keys never leave each machine
- ✅ Shared secret computed independently on both sides
- ✅ All messages encrypted with AES-256
- ✅ Each session generates new keys
- ✅ No central server - direct peer connection

## Requirements

- Python 3.8+
- cryptography library

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.
