Maybe something like this ?

#!/usr/bin/perl

use Digest::SHA;
use MIME::Base64;

my $filename = shift(@ARGV) || die("no args");

open (FILE, "$filename") ||
  die ("can't open $filename: $!\n");

while (my $line = <FILE>) {
  chomp($line);

  $context = Digest::SHA->new(1);

  $context->add("$line");

  print encode_base64($context->digest);
}

close (FILE);


Andre


On Fri, 10 Mar 2006 02:55:31 -0800 (PST)
Its Azfar <[EMAIL PROTECTED]> wrote:

> I am running qmail with ldap backend. I have an
> application (Platypus) which can connect to ldap and
> make user accounts. It forward plain text password
> from my database (MS SQL) to ldap hence userPassword
> fieled remain clear text but base_64 encoded. My old
> ldap (netscape DS) can automaticay crypt the
> userPassword attribute value with {SHA} but openldap
> dont. Can I make it possible openldap automaticaly
> crypt the userPassword attribue value with {SHA}.
> 
> OR any one guide me how to make a perl script which
> read userPassword value from a file and then convert
> it into {SHA} and then take is as a variable.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 

Reply via email to