Interesting thread.
Here's my two cents.
Security is important... so.
(a) create your own authentication scheme. for example:
The follow is not the code, but a description of what to code:
- Store their password as a MD5 hash.
- When they authenticate with your server, add (to the MD5 hash) the time, in seconds.
for example:
MD5(userspassword + timeInSeconds)
This will have the effect of creating a unique MD5 hash for their password each time they login. This approach is nearly equivilent to using the SKey / MD5 authentication scheme, and probably just as secure.
- On the server side -- allow for (say) 10 to 15 seconds for authentication...
So, your server will (once it verifies the Username) -- will add the time to the users password and will create 10 or 15 MD5 hashes in a temp array by which it will compare that password to.
Before you do all of this, you need to make sure (on the client side) you sync the GTC time to whatever the GTC time is on the server.
Now -- none of this makes much sense if they are going to be tranmitting their password and username in clear text anyway -- the md5 hash would have to occur (on the client side) before it was transmitted.
Otherwise, you'll have to use a secure server to transmit the info, then MD5 hash it... which, I think is redundant.
If you want to store your passwords encrypted, and then want to be able to decrypt them as need be, then download PGP -- http://bs.mit.edu:8001/pgp-form.html
You can call the command line from PHP and encrypt and decrypt all day.
You may then send your users a PGP encrypted email with their password. However, they will need PGP installed in order to decrypt it, and their Public Key will need to be stored in your database so that you can encrypt a message to those individuals.
PGP is probably your best solution, all around. Even if you decide to send their passwords in clear text.
You can also store their clear text passwords in another database or text file, and encrypt & decrypt that database or text file as needed... off root in a NTFS or UFS tight location.
Good luck.
Jason