- Rust 98.4%
- Nix 1.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github/workflows | ||
| src | ||
| tests | ||
| .envrc | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| cliff.toml | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
| toolchain.toml | ||
cli-p2p-messenger
A secure, peer-to-peer command-line messenger written in Rust. This tool establishes encrypted communication channels directly between clients using UDP and the Noise Protocol Framework.
Features
- End-to-End Encryption: Uses the
Noise_XX_25519_ChaChaPoly_SHA256andNoise_KK_25519_ChaChaPoly_SHA256pattern via the snow crate. - Peer-to-Peer (P2P): No central server; communicates directly via UDP.
- Key Management: Automatically generates and loads persistent
private.keyandpublic.keypairs. - Session Management: Handles Noise handshakes and maintains established transport sessions.
- CLI Interface: Command-line interface to connect, manage contacts, and send messages.
Tech Stack
- Language: Rust
- Transport: UDP
- Encryption: Noise Protocol (Noise_XX)
- Dependencies:
snow,local-ip-address
Installation
Ensure you have Rust and Cargo installed.
Run the project via:
cargo run <port>
Usage example
Instance A
cargo run 2135
Instance B
cargo run 2000
Get own IP via ip command in Istance B
ip
Your IP address is: 192.168.1.2:2000
In Instance A, type connect and enter the address of Instance B:
connect
IP (with port)?:
192.168.1.2:2000
Once the handshake is successful (Connection established!), you can start typing messages.
Commands
connect Connect to new or known peer.
messages Print the history of received messages.
ip Display your current IP address and port.
contacs List known peers.
save Saves the connections to a file
fingerprint Display own public key fingerprint
approve approve clients that want to connect
help Display help for commands
<text> Send message to current destination.