So I'm working on a mobile platform application that I'd like to have users authenticate over the web. I was wondering the best way to do security. The user is sending a password for HTTP to a php server wich authenticates against a mysql database on the same server. Obviously I don't want to send the password in plain text over the internet, but I also don't want to do 2 SHA hashes.
This is what the server looks like (in pseudocode)
$pass = $_POST['pass'];
if ((get PASSWORD where USERNAME = USERNAME) == SHA($pass)) return PASS;
This is pretty standard and I don't think there's any other way to do this. But I was wondering how I should prepare the data before sending it over the internet.
Quick Answer:It is a standard practice to send "plain text" passwords over HTTPS via POST method. As we all know the communication between client-server is encrypted as per TLS, so HTTPS secures the password.
You might be wondering why it's a bad idea to share passwords via email and the answer is a very simple one — security. Emails are often sent in “clear” or “plain” text. That means the content of the email is unencrypted. If the email is intercepted, it's trivial to extract your password from it.
You should never share your password or another individual's password for the following reasons: Your unique IPFW username and password is your identity in the digital world. Sharing passwords at the workplace is the same as giving away a personal identity.
You could use SSL if your client app supports it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With