1.Java安全通信:HTTPS与SSL
http://www.cnblogs.com/devinzhang/archive/2012/02/28/2371631.html
2.Mybatis3 generator sqlserver 配置详解及应用工具 下载
http://blog.csdn.net/woshiwxw765/article/details/7604833
3.使用mybatis+SQLServer做持久层入门
http://my.oschina.net/oyj/blog/395299
4.常用加密算法的Java实现(一)*单向加密算法MD5和SHA
http://www.blogjava.net/amigoxie/archive/2014/06/01/414299.html
5.常用加密算法的Java实现总结(二)—对称加密算法DES、3DES和AES
http://www.blogjava.net/amigoxie/archive/2014/07/06/415503.html
6.各种Java加密算法
http://www.open-open.com/lib/view/open1397274257325.html
7.JAVA文件加密解密
http://www.cnblogs.com/FCWORLD/archive/2012/10/11/2720306.html
8.程序实例:
import java.security.MessageDigest;
/***
* MD5加密 生成32位md5码
*
* @param 待加密字符串
* @return 返回32位md5码
*/
public static String md5Encode(String inStr) throws Exception {
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (Exception e) {
System.out.println(e.toString());
e.printStackTrace();
return "";
}
byte[] byteArray = inStr.getBytes("UTF-8");
byte[] md5Bytes = md5.digest(byteArray);
StringBuffer hexValue = new StringBuffer();
for (int i = 0; i < md5Bytes.length; i++) {
int val = ((int) md5Bytes[i]) & 0xff;
if (val < 16) {
hexValue.append("0");
}
hexValue.append(Integer.toHexString(val));
}
return hexValue.toString();
}
/***
* SHA加密 生成40位SHA码
*
* @param 待加密字符串
* @return 返回40位SHA码
*/
public static String shaEncode(String inStr) throws Exception {
MessageDigest sha = null;
try {
sha = MessageDigest.getInstance("SHA");
} catch (Exception e) {
System.out.println(e.toString());
e.printStackTrace();
return "";
}
byte[] byteArray = inStr.getBytes("UTF-8");
byte[] md5Bytes = sha.digest(byteArray);
StringBuffer hexValue = new StringBuffer();
for (int i = 0; i < md5Bytes.length; i++) {
int val = ((int) md5Bytes[i]) & 0xff;
if (val < 16) {
hexValue.append("0");
}
hexValue.append(Integer.toHexString(val));
}
return hexValue.toString();
}</span>