A P2P terminal chat application with friend system
Project description
P2P Terminal Chat
A decentralized peer-to-peer chat application that runs in the terminal. This application allows users to send messages and files directly to other users without the need for a central server.
Features
- P2P (Peer-to-Peer) communication
- Encrypted messages and file transfers
- Unique user IDs based on name and birth date
- Friend system with friend requests
- File sharing capabilities
- Colorful terminal interface
- Real-time messaging
- Automatic port assignment
Installation
Using pip (Recommended)
pip install p2p-terminal-chat
Or if you want to install it directly from GitHub:
pip install git+https://github.com/yourusername/p2p-terminal-chat.git
Manual Installation
- Clone this repository:
git clone https://github.com/yourusername/p2p-terminal-chat.git
cd p2p-terminal-chat
- Install the required packages:
pip install -r requirements.txt
Usage
After installation, you can start the chat application by simply typing:
p2pchat
First Time Setup
- Enter your full name when prompted
- Enter your birth date in MMDD format (e.g., 0101 for January 1st)
- The program will automatically assign a port and generate your unique ID
Available Commands
connect <user_id>- Connect to a peer using their IDsend <user_id> <message>- Send a message to a peerfile <user_id> <file_path>- Send a file to a peerfriend <user_id>- Send a friend requestfriends- Show online friendspeers- List connected peersquit- Exit the application
Example Usage
- Start the first user:
p2pchat
# Enter full name: Alice Smith
# Enter birth date: 0101
- Start the second user in a different terminal:
p2pchat
# Enter full name: Bob Johnson
# Enter birth date: 0202
- Connect the users:
connect <user_id>
- Send messages:
send <user_id> <Hello, how are you?>
- Send files:
file <user_id> </path/to/file.txt>
Security
- All messages and files are encrypted using Fernet symmetric encryption
- User IDs are generated using a combination of name and birth date
- No central server means no data is stored anywhere except on the users' machines
Notes
- Both users must be online to communicate
- Files are saved in a
downloadsdirectory - The application uses your local IP address for identification
- Your friend list is saved between sessions
- The port is automatically assigned when you start the program
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 p2p_terminal_chat-1.0.0.tar.gz.
File metadata
- Download URL: p2p_terminal_chat-1.0.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7ac419c677e79aacde2d6c0c6b0efcccbb28f378c9b6e1816a246d8a9401c12
|
|
| MD5 |
7383e95237ac91353df1990038aa6694
|
|
| BLAKE2b-256 |
fad034469ce83f1b0f9f8bfc76151c6a65f4c81dd4d4e8b7719eea6f093e4f1c
|
File details
Details for the file p2p_terminal_chat-1.0.0-py3-none-any.whl.
File metadata
- Download URL: p2p_terminal_chat-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68e48ec830f62cac98313c418c2aaaea9f620fb679075370643f8b2fc1dd6bc5
|
|
| MD5 |
6ef3a4774c5f9da849bb6a15d524fdd6
|
|
| BLAKE2b-256 |
64eb91c5d9162bdede4974098ecf267a446a3dedff07dd9200eb01b371b4e391
|