This is a discussion on Encryption within the PHP Language forums, part of the PHP Programming Forums category; Hello group, to give access to some of my pages I use a loginscript. When people register the password is ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello group,
to give access to some of my pages I use a loginscript. When people register the password is encrypted with the md5 function: $passw=md5("$inv_passw"); Now I want to have the user to ask for his password when he lost it by mail. So the encrypted password needs to be decrypted. I thought to use the next command: $uncrypted = decrypt_md5($assw); but this gives a fault: Fatal error: Call to undefined function: decrypt_md5() Can somebody tell me what I do wrong. Thnx in advance. RotterdamStudents |
|
|||
|
RotterdamStudents wrote:
> Hello group, > > to give access to some of my pages I use a loginscript. When people > register the password is encrypted with the md5 function: > $passw=md5("$inv_passw"); > > Now I want to have the user to ask for his password when he lost it > by mail. So the encrypted password needs to be decrypted. I thought > to use the next command: > $uncrypted = decrypt_md5($assw); > > but this gives a fault: > Fatal error: Call to undefined function: decrypt_md5() > > Can somebody tell me what I do wrong. md5 -can't- be decrypted... It's a one-way hash function -- MVH Jeppe Uhd - NX http://nx.dk Webhosting for nørder og andet godtfolk |
|
|||
|
Jeppe Uhd wrote:
>> to give access to some of my pages I use a loginscript. When people >> register the password is encrypted with the md5 function: >> $passw=md5("$inv_passw"); >> >> Now I want to have the user to ask for his password when he lost it >> by mail. So the encrypted password needs to be decrypted. I thought >> to use the next command: >> $uncrypted = decrypt_md5($assw); >> >> but this gives a fault: >> Fatal error: Call to undefined function: decrypt_md5() >> >> Can somebody tell me what I do wrong. > > md5 -can't- be decrypted... It's a one-way hash function And there's no such function as decrypt_md5(), hence the error message :) If you want to check a function go to www.php.net/function_name where function_name is the name of the function you want more info on. If the function exists you'll be taken directly to the manual page. If it doesn't then you'll be given a list of functions with similar names. |
|
|||
|
RotterdamStudents wrote:
> Hello group, > > to give access to some of my pages I use a loginscript. When people > register the password is encrypted with the md5 function: > $passw=md5("$inv_passw"); > > Now I want to have the user to ask for his password when he lost it > by mail. So the encrypted password needs to be decrypted. I thought > to use the next command: > $uncrypted = decrypt_md5($assw); > > but this gives a fault: > Fatal error: Call to undefined function: decrypt_md5() > > Can somebody tell me what I do wrong. Most of all, you're trying to decrypt. Instead of this, when someone loses the password you should create a new one and send it, and write that new one into database, encrypted. Berislav -- If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are Groucho, Chico, and Harpo, then Usenet is Zeppo. |