As my webserver doesn't allow use of the PHP_AUTH_USER
and PHP_AUTH_PW
keywords because of CGI (Col. Shrapnel in 'PHP_AUTH_USER not set?') I'm examining some other ways to send a user's password to the server.
Sending the password as plaintext using POST is a no go: capturing packets and looking at the header reveals the password. So I could hash the password first. But someone intercepting the packet and copying the hash and username could still login using this information, right?
Making the hash dynamic by using a timestamp could prevent copying the hash. Sending the password as (timestamp + hash(password+timestamp))
(Last.FM uses something like this). The server could then subtract the timestamp (check if it's not expired or something), and hash the known password with it and check if they are the same. But then the password has to be known by the server, so the question remains:
how to get this password safely to the server upon registering?
Then, there's https, requiring a SSL certificate, which is not available for me (not worth the money (yet?)).
Any thoughts?
p.s. In the end I want to authenticate an Android app against my webserver