Re: md5() function
| From: | Jason Gerfen | Date: | Mon, 14 Jan 2008 20:03:38 +0000 |
| Subject: | Re: md5() function | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-44522@lists.php.net to get a copy of this message | ||
Steven Cruz wrote:
> Hello;
>
> I maybe wrong, but I believe it is one way. What you need to do is take
> your input and encrypt it and check if matches your current encrypted
> value. :)
>
> peace and hugs.
>
> Miguel Guirao wrote:
>> Hi!!
>>
>> I'm using the md5() function to encrypt a password and store it into a
>> database. Now I want to retrieve that MD5 password and convert it into
>> it's
>> human readable condition.
>> Is there a function opposite to md5()??
>>
>> Best Regards,
>>
>> M Guirao
>>
>>
>
If you want to do a comparison on the md5() hash you just created you
could always run your SQL query like:
SELECT * FROM
table WHERE password = md5( $password ) LIMIT 1;
That will return a true or false value based on the md5() hash of the
$password var. But you cannot reverse the md5 hash to obtain the
original value unless you perform a crack on it using software available
software. I think what you are looking for is the base64_encode() and
base64_decode() functions which will perform a simple encoding of data.
--
Jason Gerfen
"I practice my religion
while stepping on your
toes..."
~The Ditty Bops