New Zenner
- Join Date:
- Mar 2007
- Posts:
- 4
- Plugin Contributions:
- 0
Password MD5 HASH in DB.
Hello All,
I have a whole bunch of users that I want to import into the ZCart Database and I was wondering if anyone can help me out!
The problem I am having is that my other database stores the users passwords in plain text and Zcart stores the password in some sort of md5 hash...
I have tried every method I could find in google and anything I could use from the Zcart user setup php files and simply cannot work out how the passwords are being hashed.
Here is what I have so far (which is what I have taken from the user setup pages in osc:
<?php function zen_rand($min = null, $max = null) { static $seeded; if (!isset($seeded)) { mt_srand((double)microtime()*1000000);* $seeded = true; } if (isset($min) && isset($max)) { if ($min >= $max) { return $min; } else { return mt_rand($min, $max); } } else { return mt_rand(); } } $password = 'test1'; for ($i=0; $i<10; $i++) { $password .= zen_rand(); } $salt = substr(md5($password), 0, 2); $password = md5($salt . $plain) . ':' . $salt; echo $password; ?>Now that generates the following password hash for the password test1: 6c8349cc7260ae62e3b1396831a8398f:4* 5 and I place that into the database in the same place as the user that I created using the Zcart signup page and it just wont let me login...
This is what the test1 password looks like for a user that I created using the standard method (the signup page): 0825f77f257b34bf43cfdcbccaa4622d:a* b
Thanks.
Rabbie.