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=

If anyone has any idea I would really appreciate it.  I've pasted the Java
code below just in case.

Dane Foster
Equity Technology Group, Inc
http://www.equitytg.com.
954.360.9800


import java.security.*;

public class Test
{
    public static void main( String[] args ) throws Exception
    {
        MessageDigest m = java.security.MessageDigest.getInstance( "SHA" );
        m.update( "password".getBytes() );
        byte[] digest = m.digest();
        String n = new sun.misc.BASE64Encoder().encode( digest );
        System.out.println( n );
    }
}

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to