加密,解密
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);
全文完,感谢您的耐心阅读~
欢迎大家关注我的公众号
![](https://img2020.cnblogs.com/blog/945445/202008/945445-20200817142938521-1981960238.png)