修复数据库问题

This commit is contained in:
F嘉阳
2018-01-19 23:03:34 +08:00
parent c5b41b0394
commit 4697251148
3 changed files with 4 additions and 3 deletions

View File

@@ -11,7 +11,8 @@ public class CodingTest {
System.out.println(new String(Coding.decryptBASE64(Coding.encryptBASE64(data.getBytes()))));
System.out.println(new BigInteger(Coding.encryptMD5(data.getBytes())).toString());
System.out.println(new BigInteger(Coding.encryptSHA(data.getBytes())).toString());
System.out.println(new BigInteger(Coding.encryptSHA(data.getBytes())).toString(32));
System.out.println(new BigInteger(Coding.encryptSHA(data.getBytes())).toString(16));
System.out.println(new BigInteger(Coding.encryptHMAC(data.getBytes(), Coding.initMacKey())).toString());
}

View File

@@ -40,7 +40,7 @@ public class CheckLoginServlet extends HttpServlet {
String passWord = request.getParameter("passWord");
String passWordBase64 = null;
try {
passWordBase64 = new BigInteger(Coding.encryptSHA(passWord.getBytes())).toString();//对密码进行加密比较
passWordBase64 = new BigInteger(Coding.encryptSHA(passWord.getBytes())).toString(16);//对密码进行加密比较
} catch (NoSuchAlgorithmException e) {
// TODO Auto-generated catch block
e.printStackTrace();

View File

@@ -41,7 +41,7 @@ public class CheckRegisterServlet extends HttpServlet {
String passWord = request.getParameter("passWord");
String passWordBase64 = null;
try {
passWordBase64 = new BigInteger(Coding.encryptSHA(passWord.getBytes())).toString();//对密码进行加密处理
passWordBase64 = new BigInteger(Coding.encryptSHA(passWord.getBytes())).toString(16);//对密码进行加密处理
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}