4

what's the best way to program a peer-to-peer chat with encryption. is SSL useful for p2p as the clients won't have a certificate signed by verisign,...? is it possible to program such a chat without a master-server that tells the client the ip's of their chat partner?

i'd really like to program such a chat program, because in times of all those privacy issues i want a program i really can trust. i've got some experience with network programming, but only client <-> server.

i don't want any code, just the theory part of a peer-to-peer chat (like skype).

thanks.

thomasguenzel
  • 670
  • 7
  • 25

1 Answers1

2

First, you can enforce using self signed certificates at both ends OR you can even use 'pre shared key' instead of certificate for authentication. Pre shared key is supposed to be known by all parties involved in advance.

Secondly, SSL is an encryption mechanism so it has no bearing on design of communication model i.e. client/server vs p2p.

Lastly, if both of your p2p nodes have public or live ip's and each of them knows about the other's, then you don't need any kind of central server. The real problem here is that in practice, most of machines are behind firewalls using NAT's and private ip's. So you need some kind of mechanism to traverse through NAT, determine the public ip and port in order to reach the destination machine successfully.

Take a look at the following SO question and it's answer i wrote. It mentions some techniques used by common p2p applications such as skype (knowledge of skype's protocol is limited since it is proprietary), gtalk as well as other XMPP based chat applications.

Community
  • 1
  • 1
fkl
  • 5,412
  • 4
  • 28
  • 68