Skip to main content

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

  1. Clone this repository:
git clone https://github.com/yourusername/p2p-terminal-chat.git
cd p2p-terminal-chat
  1. 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

  1. Enter your full name when prompted
  2. Enter your birth date in MMDD format (e.g., 0101 for January 1st)
  3. The program will automatically assign a port and generate your unique ID

Available Commands

  • connect <user_id> - Connect to a peer using their ID
  • send <user_id> <message> - Send a message to a peer
  • file <user_id> <file_path> - Send a file to a peer
  • friend <user_id> - Send a friend request
  • friends - Show online friends
  • peers - List connected peers
  • quit - Exit the application

Example Usage

  1. Start the first user:
p2pchat
# Enter full name: Alice Smith
# Enter birth date: 0101
  1. Start the second user in a different terminal:
p2pchat
# Enter full name: Bob Johnson
# Enter birth date: 0202
  1. Connect the users:
connect <user_id>
  1. Send messages:
send <user_id> <Hello, how are you?>
  1. 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 downloads directory
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

p2p_terminal_chat-1.0.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

p2p_terminal_chat-1.0.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

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

Hashes for p2p_terminal_chat-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c7ac419c677e79aacde2d6c0c6b0efcccbb28f378c9b6e1816a246d8a9401c12
MD5 7383e95237ac91353df1990038aa6694
BLAKE2b-256 fad034469ce83f1b0f9f8bfc76151c6a65f4c81dd4d4e8b7719eea6f093e4f1c

See more details on using hashes here.

File details

Details for the file p2p_terminal_chat-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for p2p_terminal_chat-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68e48ec830f62cac98313c418c2aaaea9f620fb679075370643f8b2fc1dd6bc5
MD5 6ef3a4774c5f9da849bb6a15d524fdd6
BLAKE2b-256 64eb91c5d9162bdede4974098ecf267a446a3dedff07dd9200eb01b371b4e391

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page