First of all, the communication can be perfectly secret even someone spies on the communication before people ever establish a contact. Many would say it is logically impossible, because they need to exchange passwords or something like that for a first time. This argument has a subtle logical flaw you are about to discover if you read about
public-key cryptography. Please see:
http://en.wikipedia.org/wiki/Public-key_cryptography[
^].
There are several well-know methods well implemented in .NET. Look for one of the
asymmetric algorithm classes (RSA is the most usually used):
http://msdn.microsoft.com/en-us/library/system.security.cryptography.asymmetricalgorithm.aspx[
^].
Now, you need to learn some networking and understand which way of networking is better for your purposes. I overview them in my past answers:
how i can send byte[] to other pc[
^],
Communication b/w two Windows applications on LAN.[
^].
—SA