Forums / Developer / Creating passwords with md5 - how?

Creating passwords with md5 - how?

Author Message

K259

Friday 22 September 2006 2:02:32 am

I have problems with user import. Don't get the correct hash_value for password_hash in ezuser table. I'm using md5_user for hashing.
my $sql = uu{ update users set password=md5(login + "\n" + password) };
Anyone have an idea?

Claudia Kosny

Friday 22 September 2006 2:33:02 am

Hi K259

I am not exactly sure what programming language your example code is in so here an example if you use PHP and raw SQL commands (without going through EZ)

$password_hash = md5('mylogin' . "\n" . 'foobar');
$query = 'UPDATE ezuser '
. ' SET password_hash = "' . $password_hash . '"'
. ' WHERE login = "mylogin"';

works fine

Greetings from Luxembourg

Claudia

K259

Friday 22 September 2006 3:07:36 am

Hi and thanks for your answer!

I'm using perl..the sql statement concatenates login and password, but I get the wrong hash_value for password_hash. Guess I've tried almost everything:
concatenate just password in plaintext, concat login+password in plaintext, concat login,password in plaintext + site + hash_type, but I know the md5_user function I shall use, only concatenate login and password in plaintext, but I don't know why the hash is not correct
:(

Claudia Kosny

Friday 22 September 2006 5:23:47 am

Thread continued here:

http://ez.no/community/forum/developer/documentation_not_correct_for_md5_hashing