Security when writing a PHP webservice?

Posted by chustar on Stack Overflow See other posts from Stack Overflow or by chustar
Published on 2010-06-02T21:01:23Z Indexed on 2010/06/02 21:04 UTC
Read the original article Hit count: 208

I am writing a web service in PHP for the first time and had ran into some security problems.

1) I am planning to hash passwords using md5() before I write them to the database (or to authenticate the user) but I realize that to do that, I would have to transmit the password in plaintext to the server and hash it there.
Because of this I thought of md5()ing it with javascript client side and then rehashing on the server but then if javascript is disabled, then the user can't login, right?

2) I have heard that anything that when the action is readonly, you should use GET but if it modifies the database, you should use POST. Isn't post just as transparent as GET, just not in the address bar?

© Stack Overflow or respective owner

Related posts about php

Related posts about web-development