简体   繁体   English

简单的客户端/服务器,TCP / IP加密消息流,SSL

[英]Simple client/server, TCP/IP encrypting the message stream, SSL

Writing a little TCP/IP client server app. 编写一个小的TCP / IP客户端服务器应用程序。 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? 我想知道有没有办法合并,使用标准的.net库某种形式的加密?

m_mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); m_mainSocket = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);

Is there any way of speficying tcp using rsa? 有没有办法使用rsa来表示tcp?

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. 我之前已经为uni做过,但那是在java中,但我知道转换它们并不困难。 Just trying not to have to reinvent the wheel... 试着不必重新发明轮子......

Or what about utilising a ssl? 或者使用ssl怎么样?

Thanks, Ron. 谢谢,罗恩。

The simplest way to encrypt your communication would be to just wrap the entire socket stream in a SslStream . 加密通信的最简单方法是将整个套接字流包装在SslStream中

This is made to work directly with TcpClient/TcpListener, so it's very easy to encrypt a data stream using this. 这可以直接使用TcpClient / TcpListener,因此使用它来加密数据流非常容易。

只需将其包装在库中,或者将其包装在SSL隧道应用程序中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM