File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Security and the fly likes Digest different on JDK1.4 and 1.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "Digest different on JDK1.4 and 1.5" Watch "Digest different on JDK1.4 and 1.5" New topic
Author

Digest different on JDK1.4 and 1.5

Yan Zhou
Ranch Hand

Joined: Sep 02, 2003
Posts: 137
java.security.MessageDigest digest = MessageDigest.getInstance( "SHA-1" );
digest.reset();
byte[] value = digest.digest("password".getBytes());

The value of digest is different from JDK 1.4 and 1.5, even when running on the same PC and having the same charset.

Did I miss anything? How can I get the same value?

Thanks,
Yan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Digest different on JDK1.4 and 1.5