In fact, both GCOS 3 and GCOS 8 have a neat facility called the intercom
file that work on the basis you describe. The mechanism is:
Hello, this is :: anybody want to tell me their program number?
hi there ::, my program number is nn, what's yours?
mm. OH, fine, now we can talk securely....