wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Need help with DigestUtils SHA encryption Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Need help with DigestUtils SHA encryption" Watch "Need help with DigestUtils SHA encryption" New topic

Need help with DigestUtils SHA encryption

Andru Relod

Joined: May 05, 2010
Posts: 2
I am working on an application in java , which creates or edit the entry values in the LDAP server. When the user submits a "Reset PIN" request, the existing certificate with the UID is removed and a new PIN is generated. The pin is encrypted as DigestUtil.sha(dn+pin) [ An excryption done for string formed ]
dn= uid=123123,code=343434,ou=Clt,o=comp
pin = code

byte[] digest = DigestUtils.sha(dn + pin);

The encryption is done and the encrypted value is set as the pin attribute in the LDAP. A one way hashcode is generated when the attribute is set.

I have another application in perl where the user would download the new certificate by providing the PIN.
when the user submits for new certificate, the same kind of encrytion happens, it then compares to the hash code generated in the above applicaiton and replies back.

My issue is that, This is working fine for most of the dn values, But for some dn, the hash codes values generated for the same pin and dn are different from both the applications.
So the user is not able to download the certificate, saying incorrect password or authentication failed.

Please let me know how can I fix it ? is there any bug in DigestUtils encryption ?
I agree. Here's the link: http://aspose.com/file-tools
subject: Need help with DigestUtils SHA encryption
Similar Threads
Migrating JAAS from JBoss to Websphere 6.1
LDAP: Add Users
Get DistinguishedName of an LDAP entry given a uid
Spring 3.1 LDAP Authentication Just Hangs: Where To Look?
How to compare LDAP password