加密,解密
String pwd="测试"; byte[] bytes = pwd.getBytes("UTF-8"); //加密 String pwdNew=new String(Base64.encodeBase64(bytes),"UTF-8"); //解密 String pwdOld=new String (Base64.decodeBase64(pwdNew.getBytes("UTF-8")),"utf-8"); System.out.println(pwdNew); System.out.println(pwdOld);