修复数据库问题
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user