0
$\begingroup$

Suppose a bunch of software entities are participating in a wide-area broadcast network (the network carries a lot of traffic, and the software entities also participate in those conversations, so their transmissions are likely to be seen by friend and foe alike). How can they find each other efficiently and establish communications, without being infiltrated by enemy agents who (we will assume) can capture and inspect any particular entity?

For example, one entity could find another candidate entity by noticing a particular type of message error or checksum, and could send a decoy message that would contain a similar type of error. But an enemy agent could do the same thing, or an enemy monitor could watch for entities engaging in this protocol.

What are the search keywords for learning about protocols that are useful in this area?

Edit to add:

My specific use case is within the BitTorrent network / ecosystem. The main function of BT is to distribute data files among interested participants. The data files are identified by a 160-byte hash (the infohash). An auxiliary network, the Distribute Hash Table (DHT), helps clients find a node that is distributing the data file having a particular infohash.

DHT nodes are identified by a random 160-byte number, and their basic operation is to ask other nodes if they know a BT node that is distributing a particular infohash. DHT nodes self-organize by their ID numbers, and searching is done by matching the hash from MSB to LSB.

If a DHT node is asked to find infohash abcdefghijklmnopqrs, then it will ask nodes it has already encountered, whose ID numbers start with abcd.... (The longer the matching prefix, the more likely that node will know the answer we're looking for.) If those nodes don't know, they recursively ask the nodes they know about with longer matching prefixes. Eventually, a node knows the exact answer, or does not know any other node closer to the exact answer, and that node's address is returned to the original querier.

So DHT nodes are continually asking each other where to find 160-bit hashes of one thing or another.

I would like my DHT nodes to be able to recognize each other by asking for particularly-formatted infohashes. For example, infohashes where every prime bit is 0. (I understand that some ordinary inquries may match this pattern as well, but that's OK -- one of my nodes might respond, but the ordinary querier wouldn't proceed with the protocol so my node will know that it's not one of my special nodes.)

The problem is, an adversary can reverse-engineer my code and determine what my special infohashes are, and can implement a node that pretends to be one of my special nodes, but which does not play nice -- it might feed me bogus data, instead of the data my nodes are actually trying to collect.

So, I would like to devise a way that my nodes can identify each other, and can detect and exclude nodes that pretend to be "on my team," but are in fact enemy nodes. Obviously, I could hard-code the IP addresses of my nodes (or something similar), but I would like to be able to start an arbitrary number of nodes running at arbitrary places around the Internet, and have them find each other and start cooperating.

$\endgroup$
8
  • $\begingroup$ Why not just use Tor or something actually designed for secretly sending files between multiple nodes if that's the goal? i'm really confused what you're trying to do $\endgroup$
    – ieatpizza
    Commented Nov 22, 2020 at 7:43
  • $\begingroup$ Use keyed hash HMAC with time stamps?. $\endgroup$
    – kelalaka
    Commented Nov 22, 2020 at 7:58
  • $\begingroup$ @ieatpizza: I'm trying to collect information about what happens in the DHT and BT, so my probes need to participate in the protocol. I would like them to be able to find each other so they can exchange information and coordinate data collection from the different portions of the DHT that each is able to observe (because each of my nodes is running at a different IP, using a different node ID, and talking to different peers). But I want to avoid getting poisoned data from other nodes that are also participating in the DHT, for purposes at odds with my purpose. $\endgroup$
    – Dave M.
    Commented Nov 22, 2020 at 15:46
  • $\begingroup$ I could have each of my probes report data back to a central server and coordinate through it (and those communications could be secured in the normal ways) but it gives me a single point of failure and makes my nodes' startup and shutdown more involved. If the nodes could find each other organically, then my central server can come & go, and I can still find whatever machines are running my node software the same way the nodes can find each other. $\endgroup$
    – Dave M.
    Commented Nov 22, 2020 at 15:50
  • $\begingroup$ you could always just have it retry uploading to the central server until it successfully uploads if you're worried about the server going down. seems like you're making it overly complicated for no reason. or if the data isn't private and you're just concerned of people feeding junk data, use keyed HMACs. $\endgroup$
    – ieatpizza
    Commented Nov 22, 2020 at 22:48

2 Answers 2

1
$\begingroup$

I'm looking for a way for one message recipient to distinguish steganographic (or other) messages from a friend client from similar messages from a foe client.

That's possible only if there's something friends know that foes don't. And if we talk crypto implemented by local-run software, that thing must be a key. If that key is not in the software itself, and that software is public, then it must be an input of the software available selectively to the "friend" instances. That does not seem to be the case here.

If we nevertheless assume such a key, we can think of using an authenticated encryption which cryptogram is indistinguishable from random for one without the key, which gives a method to hide the traffic in a context where there is legitimate reason to send arbitrary-looking data blobs like hashes. However:

  • If the software is public, the fact that it has provision allowing this can't be hidden. Only the use of that provision can perhaps be hidden.
  • That method rules out that one without the key can make a static analysis of a packet's content to tell if it contains a hidden payload (or which). But it can't rule out that such hidden payload gets indirectly detected by other means (like analysis of if there's any other reason a node could send a packet like this at that time; or the effect of that packet on the friend client software receiving it).
$\endgroup$
1
  • $\begingroup$ Thanks, that distills the question in a way that makes good sense (you need some sort of key!). I guess one thing I could do is have a start-up protocol for my instances where they generate an RSA key and have it signed by my main server. The instances can then use the signed key to validate each other. Enemy instances could also ask for a key to be signed, but they would be identifying themselves to my main server and I can refuse to sign or take some other action if I have requests from unexpected instances. $\endgroup$
    – Dave M.
    Commented Nov 23, 2020 at 19:39
0
$\begingroup$

This is called steganography, or the techniques used to hide secret messages within other messages.

If we're communicating over the internet though, it's probably a better idea to just use encryption. For example, the Tor network is quite large, and everyone's traffic on Tor theoretically should be indistinguishable, whether you are using it to access Facebook or you are an undercover intelligence agent. If enough people use Tor, your Tor traffic won't stand out (which is why it was released to the public, so the US government could have their users blend in with the traffic of users from the general public).

$\endgroup$
2
  • $\begingroup$ I guess I should have specified my question in greater detail...I'll do that now. You're right that hiding messages in other messages is steganography, but I'm looking for a way for one message recipient to distinguish steganographic (or other) messages from a friend client from similar messages from a foe client. $\endgroup$
    – Dave M.
    Commented Nov 22, 2020 at 6:18
  • $\begingroup$ @DaveM. The whole point of steganography is your foe shouldn't even know it's there. If your foe is able to recognize that there is a hidden message there it defeats the purpose. At that point you might as well just stick to regular encryption, hashing/signature algorithms. $\endgroup$
    – ieatpizza
    Commented Nov 22, 2020 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.