WIP: feat(relay): Add an initial implementation for the relay server #17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "relay"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR introduces a proposed implementation for the relay server.
It features a set of queues managed over a HTTP API, including capability for routing arbitrary messages, creating queues, adding messages to queues, retrieving them from queues, etc... Cryptography is assumed to be supplied by HTTPS; I believe for 2-hop routing that should be enough.
This is far from production ready.
Notably missing:
relaypackage 03cc5c63f4Queuestruct for managing message storage db44a8de11new_genkeymethod toQueuewith random key generation 49cc8fb602queue_setmodule c7fb8185f8/forward-messageendpoint d3c0a5e329Argument in favor of 3-hop HTTPS.
Alice and Bob are blind to each others' IPs.
I will argue here why HTTPS (or even HTTP by itself) provides enough guarantees to not reveal IP addresses.
Consider: Alice wishes to send a message to Bob. Alice and Bob must not learn of each others' IP addresses.
Bob provides to Alice through a trusted pre-existing channel the URL of a relay trusted by Bob, hereafter "Bob's Relay". Alice chooses a relay trusted by Alice, hereafter "Alice's Relay". The relays are assumed to be potentially fully-controlled by the parties that trust them.
(Alice) -- HTTP --> (Alice Relay) -- HTTPS --> (Bob Relay) -- HTTPS --> (Bob)
In this exchange, Alice's IP address is revealed only to Alice's relay, and Bob's IP address is revealed only to Bob's relay. At no point is there any exchange of network traffic directly between Alice's device and any device she does not trust. Same for Bob.
Hence, Alice and Bob never learn of each others' IP addresses.
Eve spying on a single request never learns anything new
In the exchange below, consider that Eve might peek into at most one of the requests. That's one of three situations:
In 1, Eve already knows Alice's IP address and Alice's Relay address (how else does she gain the MITM position?). By breaking into the request, Eve will learn Bob's Relay address too. However, Bob's address is never revealed to Eve, as Alice's request or message contains no information about Bob himself, only his relay. Eve thus never learns anything she doesn't know already.
In 2. Eve knows Alice's Relay and Bob's Relay. However, from this position, Eve never sees either Alice or Bob's IP addresses; at most, Eve learns of the servers... but she already knows this from the MITM position.
In 3, we get a mirror situation of 1. Eve knows Bob and Bob's Relay already even before breaking in. This request also contains no information about Alice or her relay, so Eve here learns even less.
In all three situations, Eve learns nothing that she didn't already know from her MITM position. Any single-hop MITM attempt thus never reveals additional information, even when breaking the single-hop's encryption.
Eve compromising a relay never reveals anything beyond other relays
In the exchange (Alice) -- HTTP --> (Alice Relay) -- HTTPS --> (Bob Relay) -- HTTPS --> (Bob), consider that Eve gains full control over either (Alice Relay) or (Bob Relay).
Alice's relay never observes any traffic going to (Bob). Bob's relay never observes any traffic coming from (Alice).
Thus, if Eve controls Alice's relay, Bob's IP address is protected. Similarly, if Eve controls Bob's relay, Alice's IP address is protected.
Thus: A bad trust decision by Alice never reveals Bob's IP. A bad trust decision by Bob never reveals Alice's IP.
Thus: A bad trust decision by one party cannot compromise another party's IP. Only that of their relay.
d3c0a5e329to3002e4468aclapfor CLI argument parsing and update main to support configurable port ddf23aa6d80c19620f70toc5f2ef8d7ac5f2ef8d7ato7341babb897341babb89to834646063bView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.