public String getPwd(String pwd){ String newPwd=null; try { MessageDigest md5=MessageDigest.getInstance("MD5"); BASE64Encoder base64en = new BASE64Encoder(); newPwd=base64en.encode(md5.digest(pwd.getBytes("utf-8"))); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return newPwd; }