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!

getBytes() - Encoding Style problem

843811Jun 18 2007 — edited Jun 19 2007
Hi people,

I need to encrypt a password using SHA algorithm through the MessageDigest object. Initially, I need obtain the bytes of the password String in order to pass it to the update() method of the mentioned object.

The problem is that the getBytes() method return different values on different platforms. I am using Windows and Sun Solaris OSs. I also noticed that even on the same OS, changing the jdk version will return in different result for the same String.

Could you please help me with this issue because it is getting very frustrating.

Regards George
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 17 2007
Added on Jun 18 2007
10 comments
303 views