← Projects

ZapDistribuido

Messages that find their own way across a peer-to-peer ring.

JavaMavenChord DHTAES+RSAABEMongoDB

Chord ring topology diagram

01Overview

ZapDistribuido is a secure peer-to-peer messaging application written in Java (built with Maven), developed as university coursework with two teammates. There is no centre to fail and no one to trust: peers organize into a Chord ring — a distributed hash table where finger tables route every lookup in O(log N) hops — and every security property comes from cryptography rather than from an operator.

The codebase is event-driven under the psd.group4 packages: nodes, users and services react to events like entering nodes, finger-table broadcasts, Diffie-Hellman handshakes and truststore updates, with dedicated handlers for encryption, keys, MongoDB and the node client.

02Architecture

JOIN new peer User CLI default node Wang :8080 finger tables SHA-1 · O(log N) Chord ring :port / :port+1 SEND DiffHellman DH event AES-256 session key sign SHA256+RSA route hop-by-hop verify Shamir ÷3 MongoDB Atlas persist on exit KP-ABE groups BC · JPBC · CC groups mvn clean package → java -jar ./target/ZapDistribuido-1.0-SNAPSHOT.jar 1 2 3 4 1 2 3 4 5 6
Join lane on top, send lane below — every property comes from cryptography, not from an operator.

03Security, layer by layer

04Stack

LanguageJava, built with Maven (mvn clean package into a shaded fat jar)
OverlayChord DHT — finger tables, O(log N) lookups, join/leave rebalancing
TransportSSL/TLS node links with session keys bootstrapped over a plain channel; Diffie-Hellman handshake
MessagesAES session encryption + RSA-signed hashes (confidentiality, authenticity, integrity)
GroupsAttribute-based encryption via BouncyCastle, JPBC and CloudCrypto (KP-ABEngine)
StorageMongoDB (sync driver + client-side field encryption) with Shamir Secret Sharing per message
Runtime UXTerminal UI with progress bars; logback logging; bootstrap via a default node

05Under the hood

06Running it

Build with Maven (mvn clean package) and run the jar. The first peer into the network becomes the default node, and nodes two ports apart keep one secure plus one insecure connection each. From there it is terminals all the way down:

Repository with full setup instructions →