End-to-end encrypted terminal chat using Diffie-Hellman key exchange and AES encryption
Project description
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
git clone https://github.com/manikanta-adupa/EncryptedTerminalChat.git
cd echat
pip install -e .
Usage
Start echat
Both users run the same command:
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
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 โ โ
โ โโโโโโโโโโโโโโโโโโโโโบโ โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
- Both users start echat - Each listens for incoming connections
- One user connects - Enters the other's IP address
- Accept/Reject - Receiver chooses to accept or reject
- Key Exchange - Diffie-Hellman establishes shared secret
- 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file echat-0.1.0.tar.gz.
File metadata
- Download URL: echat-0.1.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
755da5b1ed980dbf0be3f70a76fd3de19480f37e5633da19cbb7a7dc5e452a49
|
|
| MD5 |
b62a5ec68cf123c7f6c463e64b40f487
|
|
| BLAKE2b-256 |
fdcc64d7401571a7c3a060b6ec37c9991c4704393e64e8541d1be77c332bd01c
|
File details
Details for the file echat-0.1.0-py3-none-any.whl.
File metadata
- Download URL: echat-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da1762540ece920633660b2fb5b2123746a49cf81af3e45f4df47d331319f820
|
|
| MD5 |
3adac1ff9aa5d09a8e5dbdf14fd20b33
|
|
| BLAKE2b-256 |
edbf4ecf8e812cf9be5b38a550e1b2083d67cd308f92163e6dfac51c5d7ba0da
|