8 messages in net.sourceforge.lists.courier-users[courier-users] Re: MD5 passwords
FromSent OnAttachments
Mark BucciarelliJan 27, 2006 4:35 am 
Sergiy ZhukJan 27, 2006 9:43 am 
Mark BucciarelliJan 27, 2006 11:10 am 
Sam VarshavchikJan 27, 2006 3:19 pm 
Mark BucciarelliJan 29, 2006 9:24 am 
Jerry AmundsonJan 29, 2006 11:10 am 
Mark BucciarelliJan 30, 2006 2:21 pm 
Mark BucciarelliJan 30, 2006 6:34 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[courier-users] Re: MD5 passwordsActions...
From:Jerry Amundson (jer@pbs.com)
Date:Jan 29, 2006 11:10:41 am
List:net.sourceforge.lists.courier-users

On Sun January 29 2006 11:24, Mark Bucciarelli wrote:

On Fri, Jan 27, 2006 at 06:22:33PM -0500, Sam Varshavchik wrote:

Mark Bucciarelli writes:

I'm having trouble getting the mysql authdaemond module to work with MD5 password hashes.

After "authtest myuser mypass", the log says:

authdaemond: supplied password 'mypass' does not match encrypted password ' {MD5}a029d0df84eb5549c641e04a9ef389e5

You need to use base64-encoding, not hex-encoding. Something like:

$ perl -e 'use Digest::MD5 qw(md5_base64); print "{MD5}" . md5_base64("mypass") . "\n";' {MD5}oCnQ34TrVUnGQeBKnvOJ5Q

I see.

Bummer. PHP's md5() uses hex-encoding. I wanted to auth against a Drupal user db.

Like http://us2.php.net/manual/en/function.md5.php says?

<?php

function md5_base64 ( $data ) { return preg_replace('/=+$/','',base64_encode(pack('H*',md5($data)))); }