Link to home
Start Free TrialLog in
Avatar of Hepen
Hepen

asked on

Tcpclient, TcpListener, NetworkStream - Client/Server Security

I will be using Tcpclient, TcpListener, NetworkStream for my Client/Server application which will support 200-1000 users (lots of data and lots of bandwith).

The question is what is the best way to handle security?  I want the data from the client to be encrypted and secure when traveling across the network.  What is the best way to achieve this and can you provide some code that will show an example of a basic tcpclient securing data before shooting it off to a server and the tcplistener on the server (multi-threaded if possible) taking the data then unsecuring it so it can read the data.

Thank you.

Avatar of PockyMaster
PockyMaster
Flag of Netherlands image

I have no sample code for you right now, but what you might do, and what I know have been implemented before:
(Assuming you build the connection already)

Sender:EncryptPackage using
ASKER CERTIFIED SOLUTION
Avatar of PockyMaster
PockyMaster
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You might also try out the SSLStream obj:

        Dim client As New System.Net.Sockets.TcpClient()
        Dim myStream As New System.Net.Security.SslStream(client.GetStream())

you might find this discussion interesting as well:

http://www.dotnetfire.com/news.aspx?newsID=24511
Avatar of Hepen
Hepen

ASKER

That example is really not that complete. It is just up in the air it seems.

Also do I have to have a certificate that loads from a file to use the SSLstream?