This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Java MD5 Security problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Java MD5 Security problem" Watch "Java MD5 Security problem" New topic
Author

Java MD5 Security problem

Amar Naik
Ranch Hand

Joined: Sep 26, 2003
Posts: 43
hi guys

i wanted tyo know how does MD5 protocol encrypt a letter.
bcz i am having problems with the encryption.
the encrypted o/p is different on different machines.
plz help

thanks in advance
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
here is the algorithm:
http://www.faqs.org/rfcs/rfc1321.html
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Isn't this something for the security forum? --- How are you calculating the MD5 checksum? The Sun JDK contains an MD5 implementation for the JCA (Java Cryptography Architecture) API. See java.security.MessageDigest.
- Peter
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
Probably, I think he wants more of the information on the MD5 algorithm than the actual implementation. He's saying that he gets different result on differnt platforms.
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Pity he doesn't give more detail: different machines are mentioned, but are we talking about different software platforms too? If not, for example they both use the Java MessageDigest implementation, then the problem might well be an encoding problem in the conversion from a String to a byte[] (hint: enforce a standard encoding such as UTF-8 so you're independent of what the platform default encoding happens to be). The MD5 algorithm wouldn't help at all in that case. OTOH if they're different software platforms, perhaps with a broken MD5 implementation, then the algorithm might well help.
- Peter
 
GeeCON Prague 2014
 
subject: Java MD5 Security problem