the string in my C app vs what my node api receives.

"body" is the char* variable that I use with CURLOPT_POSTFIELDS.

@angristan please don't tell me you're sending the password in plain text to the server - oh no

@angristan ah I see, nice! I was worried for a second there 👀

@valiant @angristan Normally when logging in to a service, you would send the username and password just as they are to the server (over a TLS-protected connection of course, but anyway), there is not really any other way to do it

@valiant @angristan The server needs to receive the plain password so it can then hash it and compare it to the password hash in the database

The server can't accept a password hash from the client, because if it did then an attacker who stole the hashes from the database could just login by sending the hash (negating the purpose of hashing in the first place)

And encrypting the password before sending it isn't necessary because TLS already encrypts it before sending

@vurpo @angristan I am complete aware of how it would work, hence my comment in the first place. It is never safe to assume someone will always use TLS. If you use TLS, it is not going in plain text...

@valiant @angristan Oh, in that case I misinterpreted your previous response

@vurpo @angristan yeah it's all good, they responded that it was just a test anyway. Appreciate the explanation too, useful for someone who doesn't understand it. :blobheart:

Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!