On Wed, Nov 07, 2001 at 05:32:48PM -0500, Dane Foster wrote:
> Hello,
>     I'm not on the list but I'm hoping someone can help me nonetheless.
> 
> I'm a Java programmer working w/ OpenLDAP on Linux.  OpenLDAP supports the
> use of hashed passwords for binding, unfortunately it does do the hashing
> for you so this is where my direct use of OpenSSL comes in.  As a simple
> test I issued the following command at the console:
> 
> $ echo "password" |openssl dgst -sha1 -binary| openssl base64
> 
> I get the following output: yP7QDrLofxzujpDrvocMGQrDhIw=
> 
> 
> I wrote a simple Java class to verify that the program would generate the
> same hash that would be in the server.  No such luck.  It generates the
> following:
> W6ph5Mm5Pz8GgiULbPgzG37mj9g=
> 
The difference happens because echo version includes a newline. Something
like:
perl -e 'print "password";' |openssl dgst -sha1 -binary| openssl base64
gets you: W6ph5Mm5Pz8GgiULbPgzG37mj9g=

vh

Mads Toftum
-- 
With a rubber duck, one's never alone.
              -- "The Hitchhiker's Guide to the Galaxy"
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to