Re: hashing ldap entries

[email protected] (Christopher Bongaarts)
Newsgroups perl.ldap
Organization University of Minnesota
Message-ID <[email protected]>
Robert Threet wrote:
> IS there a method of calling SSHA when stuffing passwords into the
> directory?

We use the Digest::SHA1 and MIME::Base64 modules like this:

     $ctx = Digest::SHA1->new;
     $ctx->add($password);
     $ctx->add($salt);
     $hashedPasswd = '{SSHA}' . encode_base64($ctx->digest . $salt ,'');

where $salt is a four-byte random value, $password is the password to 
encode, and $hashedPasswd is the resulting SSHA string ready for stuffing.

-- 
%%  Christopher A. Bongaarts   %%  [email protected]          %%
%%  OIT - Identity Management  %%  http://umn.edu/~cab  %%
%%  University of Minnesota    %%  +1 (612) 625-1809    %%
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.