I'm trying to use PHP in a web form to let people change their passwords. The way I want to do this is to take their plaintext password, use the proper MD5 magic, and stick it into the password file. However, I can't seem to get the passwords to come out to the same ones that get generated by Linux's passwd command.
Anyone have tips on getting this to work?
You would have to use the crypt function. md5 wont match the linux passwd command.
When using crypt on your plain text password, it will always be different. So im not sure if that will work either?
Look into crypt, encrypt, decrypt
I have used the following line in my <a href=http://karisto.net/filemanager_demo/filemanager_v1m0.zip>web-based FTP client</a> to allow password management :
$passwords .= $formData["user"][$i] . ":" . crypt(trim($formData["new_password"][$i])) . "\n";