Peer Chat Theory

What is the best way to program peer-to-peer chat using encryption. SSL is useful for p2p because clients will not have a certificate signed by verisign, ...? Is it possible to program such a chat without a master server that tells the ip client its chat partner?

I would really like to program such a chat program, because during all these privacy issues, I want the program to really be able to trust. I have some experience with network programming, but only the ↔ server client.

I do not need any code, just part of the theory of peer-to-peer chat (e.g. skype).

thanks.

+4
source share
1 answer

First, you can force the use of self-signed certificates at both ends, or you can even use a "pre-shared key" instead of a certificate for authentication. The intended shared key should be known to all interested parties.

Secondly, SSL is an encryption mechanism, so it has nothing to do with the development of a communication model, that is, client / server vs p2p.

Finally, if both of your p2p nodes have an open or live IP address, and each of them knows about the other, you do not need any central server. The real problem here is that in practice most computers are behind firewalls using NAT and private ip. Thus, you need some kind of mechanism to go through NAT, determine the public ip and port in order to successfully reach the target computer.

Take a look at the next SO question and answer it. It mentions some of the methods used by regular p2p applications, such as skype (knowledge of the skype protocol is limited as it is proprietary), gtalk, and other XMPP-based chat applications.

+2
source

All Articles