Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Message Digest generating different hash for the same data

843810Nov 24 2003 — edited Nov 24 2003
Hi all,
I'm having problems with the message digest class, it is generating different hash values for the same data.
In my application I open up a binary file, read blocks of 16 bytes and generate the hash value of that block using MD5. All the hash values are exported to an output file.
After finishing this, I do it again (I'm testing some stuffs here) in the same function, with the same input file and without changing any part of the message digest instanciation. The problem is that it is giving a different output file. So, I have two output files that should be the same but for some reason the hash values exported to those files are different. Can someone please help me out?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 22 2003
Added on Nov 24 2003
1 comment
397 views