| Crates.io | sandesh |
| lib.rs | sandesh |
| version | 0.1.0 |
| created_at | 2026-01-11 15:28:44.773804+00 |
| updated_at | 2026-01-11 15:28:44.773804+00 |
| description | A P2P E2EE Terminal Messaging App |
| homepage | |
| repository | https://github.com/AkshatRai07/p2p_messaging |
| max_upload_size | |
| id | 2035967 |
| size | 47,301 |
Sandesh (Hindi for Message) is a lightweight, terminal-based Peer-to-Peer (P2P) chat application written in Rust. It features automatic local network discovery, end-to-end encryption, and a clean command-line interface.
crossterm.If the crate is available, you can install the binary directly:
cargo install sandesh
Make sure your ~/.cargo/bin is in your system PATH.
git clone https://github.com/yourusername/sandesh-p2p.git
cd sandesh-p2p
cargo run --release
Note: Since this app uses raw terminal mode and UDP broadcasting, you may need to allow it through your firewall on the first run.
Once the application starts, you will see the Sandesh prompt.
| Command | Description |
|---|---|
find |
Opens a live monitor to scan for active peers on the LAN. |
find-quick |
Prints a snapshot list of currently known peers without leaving the prompt. |
connect <IP> |
Initiates a secure chat session with a specific IP (Port defaults to 3001). |
cls / clear |
Clears the terminal screen and redraws the banner. |
exit |
Closes the application and stops background threads. |
find monitor.The codebase is modularized into four key components:
main.rs (The Controller)Handles the main event loop, TUI rendering for the menu, input processing, and command history. It acts as the bridge between user input and the network state.
network.rs (The Nervous System)Manages background threads:
HELLO_P2P) to update the peer list.crypto.rs (The Shield)Implements the security layer:
x25519_dalek to generate ephemeral key pairs. Performs a Diffie-Hellman key exchange to derive a shared secret.ChaCha20Poly1305 (AEAD) to encrypt messages. A random unique Nonce is generated for every message sent to prevent replay attacks.chat.rs (The View)Manages the active chat session state. It handles the specific UI logic for the split-screen chat view (messages on top, input on bottom) and handles the blocking/non-blocking read logic for TCP streams.
Add the following to your Cargo.toml to build the project:
[dependencies]
crossterm = "0.27"
colored = "2.0"
rand = "0.8"
chacha20poly1305 = "0.10"
x25519-dalek = "2.0"
byteorder = "1.5"
This application is intended for educational purposes. While it uses industry-standard algorithms (ChaCha20, X25519), the protocol implementation has not been professionally audited. Use with caution for sensitive communications.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Built with ❤️ in Rust.