Page 1 of 1

unencrypting values

Posted: Tue Jan 20, 2004 8:35 pm
by coindood
I have a function:

<?php
function Encrypt($string) {//hash then encrypt a string
$crypted = crypt(md5($string), md5($string));
return $crypted;
}
?>

and I want to unencrypt strings from a mysql database crypted with this function. how would I do that? For example, I have a login script that crypts the username and password, but to retrive the username to sort a table with a mysql query would be impossible becuase all I know is the username and not the crypted string!

Posted: Tue Jan 20, 2004 8:39 pm
by d3ad1ysp0rk
You can't unencrypt md5.. can you?

Posted: Tue Jan 20, 2004 9:43 pm
by dull1554
all you have to do is collect the password through POST or....if your stupid GET, the encrypt it in the same manner as whats in the database

Posted: Wed Jan 21, 2004 7:55 am
by Roja
I've answered a similar post once before:

viewtopic.php?p=79450#79450

Should clear things up a bit.

Posted: Wed Jan 21, 2004 1:47 pm
by coindood
Thanks Roja, and yes, dull, I went everywhere looking, and I'm trying to retrive the username without the person logging in for a news updates site so I can see who posted the message. And no, I'm not stoopid (sic)

Posted: Wed Jan 21, 2004 3:05 pm
by dull1554
i was just kidding, i was just implying that you would be stupid to process your login script with GET, i was not trying to call you stupid....just sayin

Posted: Wed Jan 21, 2004 3:18 pm
by coindood
:lol: Get rulez. it just |9 0 ><