No description
  • Rust 98.4%
  • Nix 1.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-05-31 14:18:03 +02:00
.github/workflows fix(release): remove --locked flag from cargo build command 2026-05-26 22:44:56 +02:00
src feat(network): implement structured error propagation 2026-05-31 14:18:03 +02:00
tests feat(network): implement structured error propagation 2026-05-31 14:18:03 +02:00
.envrc not working yet 2025-11-05 10:40:33 +01:00
.gitignore chore(gitgnore): add 'messages.json' 2026-01-16 13:45:15 +01:00
Cargo.lock refactor(errors): simplify error enums 2026-05-31 12:42:23 +02:00
Cargo.toml refactor(errors): simplify error enums 2026-05-31 12:42:23 +02:00
cliff.toml ci: add release workflow 2026-02-14 18:38:34 +01:00
flake.lock feat(nix): add naersk build suppor 2026-02-14 19:25:25 +01:00
flake.nix feat(nix): add naersk build suppor 2026-02-14 19:25:25 +01:00
LICENSE Add: GNU GPL v3 license 2025-12-01 17:12:21 +01:00
README.md docs: update readme 2026-02-14 17:10:55 +01:00
toolchain.toml build: setup coverage tools and fix library imports 2025-12-07 13:03:45 +01:00

cli-p2p-messenger

codecov

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_SHA256 and Noise_KK_25519_ChaChaPoly_SHA256 pattern via the snow crate.
  • Peer-to-Peer (P2P): No central server; communicates directly via UDP.
  • Key Management: Automatically generates and loads persistent private.key and public.key pairs.
  • 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.