Skip to content
1kSenseiPublic

About

A P2P anonymous encrypted messaging app that runs on Tor.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

p2p-anon-chat

A peer-to-peer, end-to-end encrypted chat application with a desktop GUI, written in Go, running entirely over Tor. There's no account, no central server, and no IP address ever exchanged between peers — you're reachable at a .onion address, and every connection to a contact is built through a Tor circuit automatically.

  • Transport: Tor onion services. Each instance brings up its own ephemeral hidden service (internal/torctl, internal/tornet) and dials contacts through Tor's SOCKS proxy — building a fresh circuit per-connection with no extra steps.
  • End-to-end encryption of chat payloads using NaCl box (X25519 + XSalsa20-Poly1305), on top of Tor's own connection security.
  • Full desktop GUI built with Fyne (Linux, macOS, Windows).
  • Usernames: pick your own, or generate a random AdjectiveNoun#### gamertag-style name (the same shape classic Xbox Live suggested names use), done locally — there's no registry to check it against.

Read docs/SECURITY.md before relying on this for anything sensitive. It's an educational / starting-point implementation, not an audited product.

Requirements

  • Go 1.22+
  • A running Tor daemon with its control port enabled — see docs/TOR_SETUP.md (this is the main setup step; don't skip it)
  • On Linux, Fyne's usual GUI build dependencies (a C compiler, plus X11/Wayland + OpenGL headers) — see the Fyne getting started guide if go run fails with a graphics-related error

Quick start

git clone <this-repo>
cd p2p-anon-chat
go mod tidy      # fetches Fyne + golang.org/x/{crypto,net}
go run ./cmd/p2pchat

On first run this:

  1. Connects to your local Tor control port and authenticates.
  2. Asks Tor to stand up an ephemeral onion service and prints your .onion address to the terminal — this is your address on the network, and it stays the same across restarts (the key is saved to ~/.p2pchat/onion.key).
  3. Opens the GUI, where you can see/copy your address, add a contact by pasting their onion address, and start chatting.

Building a Tor circuit to a new contact typically takes several seconds — that's normal, not a hang. The GUI shows a "Connecting..." indicator while this happens.

How it fits together

cmd/p2pchat/main.go     wires everything together, owns the handshake logic
internal/identity/      persists the Tor onion-service key so your address is stable
internal/username/      random "AdjectiveNoun1234" name generator + validation
internal/crypto/        NaCl box end-to-end encryption for chat payloads
internal/torctl/        minimal hand-rolled Tor control-port protocol client
internal/tornet/        onion-service listener + SOCKS5 dialing, wire framing
internal/storage/       local JSON config: your username + known contacts
internal/gui/           Fyne desktop UI

See docs/ARCHITECTURE.md for the message flow and docs/SECURITY.md for the threat model and known gaps.

Building a binary

go build -o bin/p2pchat ./cmd/p2pchat

Contributing

This is meant as a solid, readable starting point rather than a finished product — issues and PRs that hunt down the gaps in docs/SECURITY.md are especially welcome. Run go test ./... before sending a PR.

License

MIT — see LICENSE.

About

A P2P anonymous encrypted messaging app that runs on Tor.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages