[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Hashed ROOTPW



On Thu, 2 May 2002, Roman Pagac wrote:

> Dear colleagues!
>
> I have problem with attribute ROOTPW in slapd.conf file. I would like to
> store value of this attribute hashed (better than plain text). I have hashed
> my root password ("abc123") with MD5 algorithm. My slapd.conf file is
> following:

Try running this perl script if you don't want to/can't run slappasswd
(if you need this to be in a CGI or whatever).

#!/usr/bin/perl -w

use Digest::MD5;
use MIME::Base64;
use strict;

print "\n";
die "Usage: $0 password\n\n" if ! $ARGV[0];
my $password = $ARGV[0];
my $ctx = Digest::MD5->new;
$ctx->add($password);
my $encpass = '{MD5}' . encode_base64($ctx->digest,'');
print "$encpass\n";
print "\n";

> rootpw          "{md5}E99A18C428CB38D5F260853678922E03"

Here's what it pukes out for 'abc123' as MD5:

{MD5}6ZoYxCjLONXyYIU2eJIuAw==

  Jason

-- 
Jason Englander
jason@englanders.cc