Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Java in General and the fly likes Digest in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Digest in java" Watch "Digest in java" New topic

Digest in java

Bharat Khillari

Joined: Jun 29, 2001
Posts: 7
Please can naybody help me out...
I have one script called digest on linux when i am passing input "bharat" to it it's giving me output : "37V7Ll82wfiT28Et1miX1A==".
When i am passing that same string to my java digest class it's giving me output: "[B@3ac748".
Since i have to store that encrypted password in ldap for further authetication what is the proper way for digest please help me out?
Why the results are different?
Bharat A. Khillari
David Bejjam

Joined: Aug 16, 2001
Posts: 17
For converting byte array to String try using new String(byte[]) and not toString() method. Hope it works.
I agree. Here's the link:
subject: Digest in java
It's not a secret anymore!