Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
180 views
in Technique[技术] by (71.8m points)

c# - Is NetworkStream Secure?

I'm working on an existing C# .NET 4.5 application. It has a component that downloads data from a mainframe (I don't have details on what kind) using a TcpClient with NetworkStream Read and Write commands. The developer that originally wrote the code has left the company and the audit area is now questioning the security of how these mainframe datasets are being downloaded. The original developer's naming conventions seem to indicate that FTP was being used, but reading the documentation on TcpClient and NetworkStream, there is no mention of the protocols that are used to actually transfer the data.

My networking experience is very limited, but my understanding is that the TcpClient just provides the network connection and then some sort of application protocol (such as FTP) needs to run on the TCP connection to actually move the data.

So my question is, what protocol does NetworkStream.Read use and is it secure? If it's not secure, what is a good alternative?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

By itself, System.Net.Sockets.NetworkStream does not have any inherent security. You can visualize this by forming up a connection and capturing the traffic with Wireshark.

If you need to secure your data, have a look at SslStream or NegotiateStream to see if they fit your needs for custom client/server applications.

Alternately, depending on your application, you may be able to serve your data sets over HTTPS. If you just need to protect the integrity of the data sets and not the confidentiality, you could also add digital signatures to data sets and check those signatures after they are received.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...