Does anyone have a script that will generate unique md5 password and salt values for mass imported profiles?
Does anyone have a script that will generate unique md5 password and salt values for mass imported profiles? |
If you can't come up with that script did you think about using the lost password e-mail in a script?
Csampson |
These are new profiles being transferred from a different source.
The profiles will receive emails notifying them of their new passwords (usernames already known). I was told by Anton that I need to create a script that will generate md5/salt values of original or new passwords using Dolphins process. I don't know how to write that script. So I was hoping someone had already come up with a usable script that would convert existing passwords into Dolphin accepted Md5 and Salt values. |
if you want to stick with the default password system you need to get an sh1 hash of the md5 + salt.
So if you have the current users paswords as md5 there is no nead to email them new passwords, just have a script made to add the salts to the database, the hash the salt and md5 using sh1 Or you could turn off sh1 and the salts and just use md5. Light man a fire keep him warm for a night, light him ON fire & he will be warm the rest of his life |
The original passwords are not in MD5 format.
As I mentioned earlier, I'm looking for a script if someone has one that I could use. If reasonable, will pay for one from a trusted contributor to this forum. |
What format are they in?
Light man a fire keep him warm for a night, light him ON fire & he will be warm the rest of his life |
Search Google for an MD5 Generator script. There are a few out there. Then ask AntonLV for help re SALT. The original passwords are not in MD5 format.
As I mentioned earlier, I'm looking for a script if someone has one that I could use. If reasonable, will pay for one from a trusted contributor to this forum.
There are none so blind as those that will not see. |
The password can be easily converted while it's being stored into the database. The following MySQL queries will convert a password to make it compatable with dolphin. UPDATE `Profiles` SET `Salt` = CONV(FLOOR(RAND()*99999999999999), 10, 36) WHERE `ID`='UserID'; UPDATE `Profiles` SET `Password` = SHA1(CONCAT(md5('Password'), `Salt`)) WHERE `ID`='UserID'; Password is the clear text password to be converted to a hashed version. https://www.deanbassett.com |
There is no need for a 'generator script' as MySQL and PHP provide md5 functions.
mysql> SELECT MD5('secretpassword');
<?php
Light man a fire keep him warm for a night, light him ON fire & he will be warm the rest of his life |
Ok, thanks. I wasn't sure about md5 generators already found because I still needed to get them tied to the Dolphin system. I noticed that the MD5 hash for a particular password via internet generators are different than the hash generated through Dolphin.
I will work with your suggestions. Thanks for the help. |
The dolphin password is formed by taking a plain text password. Hashing it with MD5 the taking the resulting MD5 hash and hashing that with SHA1 and then concatenate the salt to the end of the SHA1 hash https://www.deanbassett.com |
Actually, my answer is incorrect. I have the salt in the wrong place, so ignore my post above this one. It's inaccurate. But i did notice that LeatherSportB had posted the hashing in the correct order. So my answer was pointless anyway. https://www.deanbassett.com |
Does anyone have a script that will generate unique md5 password and salt values for mass imported profiles? Little late, but I also was looking for this specified function that works with Dolphin 7.0.x auth. Here it is, if anybody still need it: // $iPassword -- your plain text string with password you want to use $salt = base64_encode(substr(md5(microtime()), 2, 6)); $iNewPassword = sha1(md5($iPassword) . $salt);
You get: $salt and $iNewPassword to push into database. http://boonexpert.com |
this it from forget.php. After inserting your profiles in your table get all profiles id in an array and loop through it and run this on every loop, obviously make changes as needed. function generateUserNewPwd($ID) { $sPwd = genRndPwd(); $sSalt = genRndSalt();
$sQuery = " UPDATE `Profiles` SET `Password` = '" . encryptUserPwd($sPwd, $sSalt) . "', `Salt` = '$sSalt' WHERE `ID`='$ID' ";
db_res($sQuery); } EDIT: Just noticed its an ages old topic. lol so much to do.... |
And where is genRndPwd() and genRndSalt();? I guess he can make something more simple like
function generateUserNewPwd($ID, $oldPswd){
$salt = base64_encode(substr(md5(microtime()), 2, 6)); $iNewPassword = sha1(md5($oldPswd) . $salt); $sQuery = " UPDATE `Profiles` SET `Password` = '$iNewPassword', `Salt` = '$salt' WHERE `ID`='$ID' ";
db_res($sQuery); }
and put this function into Profiles table cycle. http://boonexpert.com |