wood burning stoves 2.0*
The moose likes Security and the fly likes How to generate MD5 hash? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "How to generate MD5 hash?" Watch "How to generate MD5 hash?" New topic
Author

How to generate MD5 hash?

M K Rayapudi
Ranch Hand

Joined: Feb 19, 2007
Posts: 157
Hi,
I am using the following code to generate MD5 hash

Is this correct or not? (Why I am asking like this is because, sites like are showing a different hash)
What is wrong in my code?

Thank you.


R6i
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41151
    
  45
Does that site also use the UTF-32 encoding? MD5 predates Unicode, so that seems unlikely.

Furthermore, the digest is ASCII - no base64 encoding is necessary, so that site most likely doesn't do that.


Ping & DNS - my free Android networking tools app
Zandis Murāns
Ranch Hand

Joined: Aug 18, 2009
Posts: 174

ok, I'll just give you sample code, you study it by your own:
M K Rayapudi
Ranch Hand

Joined: Feb 19, 2007
Posts: 157
Thank you Dittmer & Zandis.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to generate MD5 hash?
 
Similar Threads
MD5 Digest Problem in Java
need to generate RSA keys from txt files
Java Cryptography Extension giving me different result every time
MD5 Digest Problem in Java
MD5