Forums / Developer / Documentation not correct for md5 hashing?

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

eZ debug

Timing: Jan 18 2025 10:35:41
Script start
Timing: Jan 18 2025 10:35:41
Module start 'content'
Timing: Jan 18 2025 10:35:41
Module end 'content'
Timing: Jan 18 2025 10:35:41
Script end

Main resources:

Total runtime0.1977 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0093 588.9609180.8125
Module start 'content' 0.00930.0064 769.7734101.9297
Module end 'content' 0.01570.1820 871.7031530.1250
Script end 0.1977  1,401.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00391.9711200.0002
Check MTime0.00150.7489200.0001
Mysql Total
Database connection0.00090.467210.0009
Mysqli_queries0.142271.93381410.0010
Looping result0.00160.82461390.0000
Template Total0.181591.810.1815
Template load0.00110.545210.0011
Template processing0.180591.261610.1805
Override
Cache load0.00070.348010.0007
Sytem overhead
Fetch class attribute can translate value0.00100.513310.0010
XML
Image XML parsing0.00020.117310.0002
General
dbfile0.00231.1518200.0001
String conversion0.00000.003030.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

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

Time used to render debug report: 0.0002 secs