How To Convert Crypt To Md5?

How do I create a MD5 hash in Java?

  • This is the php script I'm using md5(md5(salt)md5(text)); How can I use this function in Java and get the same hash?

  • Answer:

    MessageDigest is your friend. Call getInstance("MD5") to get an MD5 message digest you can use. import java.security.*; import java.math.*; String s="This is a test"; MessageDigest m=MessageDigest.getInstance("MD5"); m.update(s.getBytes(),0,s.length()); System.out.println("MD5: "+new BigInteger(1,m.digest()).toString(16));

Vinnie Matronia at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.