简体   繁体   中英

Sending Data Securely over Sockets

I have, after aa hard work, managed to compose a functioning chat server that checks a SQL database for a username and password, and then let's you in if your authentication is good.

Alas, I present the password to the server...... in plaintext, with a sendto() command.

Can you say man-in-the-middle attack?

In this very nascent stage, I can warn people to use a unique password, never use it for anything else, ect. But this is really unacceptable.

What popular methods exist for securely transporting data over sockets?

I hope this question is not unacceptably open-ended, but I can't be the only one who would benefit from such a list/resource!

Encrypt the connection, such as via the OpenSSL library, or Microsoft's SChannel framework. If that is not an option, then you will have to at least encrypt the password before sending it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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