Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

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!

how to decrypt the md5? -JSP

843840Aug 17 2007 — edited Aug 17 2007
I have the encryption code, but cant figure the decryption part, anyone have the idea?


**** Encryption Code ****
String plainText = "123456";
MessageDigest mdAlgorithm = MessageDigest.getInstance("MD5");
mdAlgorithm.update(plainText.getBytes());

byte[] digest = mdAlgorithm.digest();
StringBuffer hexString = new StringBuffer();

for (int i = 0; i < digest.length; i++) {
plainText = Integer.toHexString(0xFF & digest);

if (plainText.length() < 2) {
plainText = "0" + plainText;
}

hexString.append(plainText);
}

out.print(hexString.toString());
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 14 2007
Added on Aug 17 2007
3 comments
448 views