Documentation not correct for md5 hashing?

Author Message

K259

Friday 22 September 2006 4:50:36 am

According to hash_type in site.ini and documentation for md5_user, the password_hash is generated by concatenating login, password, but this can not be. I testet to make an md5 hash out of my login+pass, but they don't match my password_hash in the ezuser table.

Why? Is there anything missing in the docs here, or does md5_user contain more values to hash?

Claudia Kosny

Friday 22 September 2006 5:18:45 am

Hi K259

Google is definitely your friend. As my Perl knowledge is rudimentary at best I don't know how useful these tips are, but this is a common problem.

http://lu.php.net/manual/en/function.md5.php#31238
http://www.jaguarpc.com/forums/showthread.php?p=100421

and
There is no such thing as incompatibility between different implementation of MD5. There only one MD5 in the world. Probably, you want to $digest = $ctx->hexdigest; in perl.

(No clue what it means, I hope it helps you)

Greetings from Luxembourg

Claudia

Kristof Coomans

Friday 22 September 2006 5:21:16 am

Hi K

md5_user:
$str = md5( "$user\n$password" );

md5_site:
$str = md5( "$user\n$password\n$site" );

md5_password:
$str = md5( $password );

(taken from kernel/classes/datatypes/ezuser/ezuser.php)

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

K259

Friday 22 September 2006 5:26:48 am

This:
md5_site:
$str = md5( "$user\n$password\n$site" );

What if I got a letter ö in the SiteName under settings/site.ini.

I have a sql-statement which don't take this variable because there's an error on the site variabel.

I tried: $str = md5( "$user\n$password\n"xxxöxxx"" ); But I can't enter this ö in the script (VI editor), it won't allow me.

Any ideas how I can get around this? When SiteName contains unsupportet letters..?

Thanks

Claudia Kosny

Friday 22 September 2006 5:38:43 am

Hello K259

This seems to depend on the database or on the character set used.
SELECT MD5( 'ö testing' ) worked fine for me on a utf8 website with utf8 database.

I think if you cannot use the md5 function of SQL with your setup you have to persevere and your perl to produce a php type md5 string. Then there should not be a problem as the md5 contains only 'legal' characters.

Claudia

K259

Friday 22 September 2006 5:59:31 am

Hi Claudia!

Does select æ work?

Claudia Kosny

Friday 22 September 2006 6:37:14 am

Yes.

Paul Borgermans

Friday 22 September 2006 8:36:46 am

Hi Claudia

Could you contact me outside these forums?
My email: paul [dot] borgermans [at] gmail [dot] com

Have a nice weekend

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

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:29:27
Script start
Timing: Jan 31 2025 00:29:27
Module start 'layout'
Timing: Jan 31 2025 00:29:27
Module start 'content'
Timing: Jan 31 2025 00:29:27
Module end 'content'
Timing: Jan 31 2025 00:29:27
Script end

Main resources:

Total runtime0.0227 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0041 588.2656151.2266
Module start 'layout' 0.00410.0031 739.4922220.7188
Module start 'content' 0.00730.0137 960.21091,005.8359
Module end 'content' 0.02100.0017 1,966.046937.9922
Script end 0.0226  2,004.0391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002812.2477140.0002
Check MTime0.00114.8820140.0001
Mysql Total
Database connection0.00052.025810.0005
Mysqli_queries0.00198.372830.0006
Looping result0.00000.035810.0000
Template Total0.00125.210.0012
Template load0.00094.034910.0009
Template processing0.00031.170310.0003
Override
Cache load0.00062.824610.0006
General
dbfile0.00031.169280.0000
String conversion0.00000.023240.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