Hi,

I already have a perl script that encrypts MD5 passwords (found in OpenLDAP FAQ). For 
my testing I used a C source code I recompiled, but it's not my real problem I guess : 
I compared hashed passwords with the ones given in RFCs and my program seems to be ok.

My main problem stands in the syntax I have to use to set the userPassword value in 
the LDAP server. 
In my LDIF I use : 
userPassword: {MD5}X098f6bcd4621d373cade4e832627b4f6==
Is this correct ? (should mean "test" in clear)

thanks for your script and your attention !

On Thu, 5 Jul 2001 16:14:41 +0200 Henning Brauer <[EMAIL PROTECTED]> wrote:
>On Thu, Jul 05, 2001 at 02:03:05PM -0000, [EMAIL PROTECTED] wrote:
>> Have you got an example of password you use ? (I wonder if I use the 
>> right syntax...) or an ldif file  for a user, with hashed password and 
>> it cleartext equivalent ?
>
>Quoting Dan: "This is Unix, stop acting so helpless".
>
>Due to the heat I'm glad enough to share my password crypt function (perl):
>
>sub crypt_passwd {
>    my($passwd) = @_;    
>    @times=gmtime;
>    srand($times[0] * $times[1] | $$);
>    @alpha = ('a'..'z');
>    $salt = @alpha[rand(25)] . @alpha[rand(25)];
>    $passwd = crypt($passwd, $salt);
>    return $passwd;
>}
>
>then you can just write the result to the LDIF like
>
>print "UserPassword: {crypt}" . crypt_password($cleartextpassword) . "\n";
>
>-- 
>* Henning Brauer, [EMAIL PROTECTED], http://www.bsws.de *
>* Roedingsmarkt 14, 20459 Hamburg, Germany               *
>Unix is very simple, but it takes a genius to understand the simplicity.
>(Dennis Ritchie)
>

--------------------------------------------------
Totally Amazing Search Results - Just C4 Yourself!
http://www.C4.com - Total Search Technology

Reply via email to