cant figure out if passwords are encrypted.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

cant figure out if passwords are encrypted.

Post by psychotomus »

I"m trying to retreive the passwords from database (forgot pasword feature)
This is how password is inserted into database

$password = $_POST['password'];

$result=MYSQL_QUERY("INSERT INTO owners (id,confirmed,confirmcode,name,email,password,phone)"."VALUES ('NULL', '0', '$confirmcode', '$name', '$email', '$password', '$telephone')");


field password is TEXT

heres how i'm trying to retreive the password

$result = mysql_query("SELECT password FROM writers WHERE email='$email'");
$pass = mysql_fetch_object($result);


$pass->password returns a string like "e6b5a70d236a5869e77d7572ac6d98e3"
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

psychotomus wrote: $pass->password returns a string like "e6b5a70d236a5869e77d7572ac6d98e3
I believe that is md5 encryption of the password text.
use md5($password) and compare the $pass->password
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

Post by psychotomus »

anyway to decrypt it?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Generally, no.
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

No way through php as far as I know but on search I got a url which gives the information on
md5 ecnryption and decryption which on giving the word does encryption and decryption
psychotomus
Forum Contributor
Posts: 487
Joined: Fri Jul 11, 2003 1:59 am

Post by psychotomus »

i'll just reset the password and send new password =0
Post Reply