如何使用加密密码或其他方式(客户端)连接到套接字。 [英] How to connect to socket using encrypted password or another way (Client).

查看:98
本文介绍了如何使用加密密码或其他方式(客户端)连接到套接字。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的客户端使用以下方式连接到具有IP的服务器:

My client connects to a server with IP, using this way:

public static Socket _clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

_clientSocket.Connect(IPAddress.Parse(" 123.123。 123.123","11525)

_clientSocket.Connect(IPAddress.Parse("123.123.123.123"), 11525)


在C#中,每个人都可以看到你的应用程序的源代码,所以想法是创建一个将被发送到服务器的加密密码。问题是,即使我加密密码,当有人看到源代码时,他们
也可以发送加密密码。有没有办法让客户端看不到加密的密码?
In C# everyone can see the source code of your application, so the idea is creating an encrypted password that will be sent to the server. The problem is that even if I encrypt the password, when someone sees the source code they can send the encrypted password too. is there a way to make it impossible for the client to see the encrypted password?

推荐答案

源代码无关紧要。我所要做的就是嗅探你的网络并看到同样的事情。所以,你不能阻止别人看到你的加密密码。关于源代码无关紧要。如果你想要真正加密的通信
那么你需要切换到HTTPS或其他东西,但这对TCP服务器不起作用。

It doesn't matter about the source code. All I have to do is sniff your network and see the same thing. So no you cannot prevent someone from seeing your encrypted password. Doesn't matter about the source code. If you want truly encrypted communication then you'd need to switch to HTTPS or something but that isn't going to work for a TCP server.

如果你想限制连接到您的服务器然后为什么不进行IP过滤或什么?这很简单。当然它可能是欺骗性的,但在一个网络上它应该不是问题。

If you want to limit connections to your server then why not just do IP filtering or something? It is pretty straightforward. Of course it can be spoofed but on a single network it shouldn't be an issue.


这篇关于如何使用加密密码或其他方式(客户端)连接到套接字。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆