Código
public class Md5 { try { if (!CadenaOriginal.equalsIgnoreCase("")) { md.reset(); md.update(CadenaOriginal.getBytes()); byte bytes[] = md.digest(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < bytes.length; i++) { if (hex.length() == 1) { sb.append('0'); } sb.append(hex); } md5 = sb.toString(); } md5 = "Error inesperado"; } return md5; } Md5 obj = new Md5(); try { } } }