PDA

View Full Version : how to modify imported passwords with md5


pussySniper
Wed 12th May '04, 12:24pm
Hi, i'm trying to write my script to import users from another forum, i'm having trouble with the password.

I have done this...
included the md5.js file in a php script,
I copied in my script the function which creates the Salt in variable $Salt (taken from one of the files in VB3)

took the password from a user which was 'hello' (it wasnt really but lets pretend)

$oldPassword = 'hello'
I then did
$password = md5 ($oldPassword . Salt);
This actually seems to work, as it returned something like
$password = f6cdf703fa4faefd99ab85d25d5f0448
$Salt = G<)
but... then i cut and paste these values in the database (password and salt field) and when i tried to login it gave me 'wrong username or password' error.
what am I doing wrong?

Floris
Wed 12th May '04, 1:58pm
Compare it with how vBulletin has it done :)

WebMare
Fri 14th May '04, 1:39pm
look at the structure of the table, be sure that the Length of the field is plus than the pass, (i speak spanish and my english is not very good)

ex:

Pass: f6cdf703fa4faefd99ab85d25d5f0448
Characters: 32

if the lenght of the field is 30 or 20 when you paste the pass, the pass is not complete....

you understand me?? :confused: :p

Mr. HillBilly
Mon 7th Jun '04, 1:23am
MD5 encrypts the passwords.

Icheb
Mon 7th Jun '04, 12:00pm
md5 hashes them, it doesn't encrypt them.

megahard
Wed 16th Jun '04, 9:32am
md5 hashes them, it doesn't encrypt them.
That's the oldest line on vBulletin

Could you not use PhpMyAdmin, and copy the table

Then rename the password field, userid and username field to whatever vBulletin uses

Then just insert with:

INSERT INTO table (username, password) VALUES ('$username', md5('$password')

or if that doesn't work just use the PHP function md5() outside of the mysql_query parenthesis