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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 00:34:39
Script start
Timing: Jan 31 2025 00:34:39
Module start 'layout'
Timing: Jan 31 2025 00:34:39
Module start 'content'
Timing: Jan 31 2025 00:34:39
Module end 'content'
Timing: Jan 31 2025 00:34:39
Script end

Main resources:

Total runtime0.0253 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 588.1328151.2109
Module start 'layout' 0.00550.0052 739.3438220.6875
Module start 'content' 0.01070.0129 960.0313997.6953
Module end 'content' 0.02360.0016 1,957.726633.9922
Script end 0.0253  1,991.7188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002610.2858140.0002
Check MTime0.00104.0580140.0001
Mysql Total
Database connection0.00093.596310.0009
Mysqli_queries0.003513.724730.0012
Looping result0.00000.098910.0000
Template Total0.00124.610.0012
Template load0.00103.758410.0010
Template processing0.00020.833810.0002
Override
Cache load0.00062.323410.0006
General
dbfile0.00030.992180.0000
String conversion0.00000.042440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs