Writing a little TCP/IP client server app. Basically it creates a server, and then you can create several different clients and set up a bit of a chat session. What I am wondering is there is any way to incorporate, using standard .net libraries some form of encryption?
m_mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
Is there any way of speficying tcp using rsa?
Or would you (me that is) have to write some custom libaries to do key exchange and then encrypt the subsequent chat messages? I have done that before for uni but that was in java but I know it would'nt be hard to convert them. Just trying not to have to reinvent the wheel...
Or what about utilising a ssl?
Thanks, Ron.
TCP/IP (SSL) is a collection of specialized communications protocols and functions organized into a stack of the following layers. Each layer provides services to the layer above it and uses the services below it.
SSL/TLS typically runs on top of TCP, but there is nothing to stop you from running it on UDP, SCTP or any other transport layer protocol. As a matter of fact HTTPS over TCP and UDP are both defined as "well known" by IANA and have reserved port numbers.
Based on our experiments, we make a conclusion that TCP with SSL is more secure, compared with TCP connection which provides reliable, ordered, error-check delivery of a stream between server and client. Due to encrypt and decrypt data, transmission speed is more slow than normal.
TLS/SSL provides secure (encrypted) communication between a remote client and a TCP/IP application server. Under TLS protocol, the application server is always authenticated.
The simplest way to encrypt your communication would be to just wrap the entire socket stream in a SslStream.
This is made to work directly with TcpClient/TcpListener, so it's very easy to encrypt a data stream using this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With