MD5 is a widely used hashing algorithm in many industries. You can use following Example to get MD5 encrypted format of a string. import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class MD5CheckSumExample { public static void main(String[] args)throws Exception { System.out.println("MD5 hash encrypted data of 67543 is "+generateMD5Hash("67543")); } public static String generateMD5Hash(String strToBeHashed) { MessageDigest md = null; try { md = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException nsae) { nsae.printStackTrace(); throw new RuntimeException("Unable to MD5 MessageDigest"); } if (md != null && strToBeHashed != null) { byte[] paramBytes = strToBeHashed.getBytes(); byte[] digest = md.digest(paramBytes); StringBuffer sb = new StringBuffer(); for (int i = 0; i < digest.length; i++) { sb.append(Integer.toString((digest[i] & 0xff) + 0x100, 16).substring(1)); } System.out.println("Generated MD5 Hash String is "+sb.toString()); return sb.toString(); } System.out.println("MD5 Hash String could not be generated because md value is "+md+" and strToBeHashed value is "+strToBeHashed); return null; } }