12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
网络知识 时间:2024-12-03 15:09:49
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
数据库中对密码进行加密的方法有以下几种1.BASE64加密方法如下:String encode = (new BASE64Encoder()).encode(s.getBytes());System.out.println(encode);byte[] bytes = (
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
数据库中对密码进行加密的方法有以下几种
1.BASE64加密
方法如下:
String encode = (new BASE64Encoder()).encode(s.getBytes());
System.out.println(encode);
byte[] bytes = (new BASE64Decoder()).decodeBuffer(encode);
System.out.println(new String(bytes));
2.sha加密
方法如下:
MessageDigest sha = MessageDigest.getInstance("SHA");
sha.update(s.getBytes());
3.MD5加密
方法如下:
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(s.getBytes());
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19