刘韬 %!s(int64=2) %!d(string=hai) anos
pai
achega
9f4ae3a838

+ 4 - 6
DataFusion/src/com/zskk/control/ViewController.java

@@ -55,11 +55,9 @@ public class ViewController extends Controller {
 	 */
 	public void getExam() {
 		try {
-	        String IV = "0000000000000000";
-	        String aesEncryptStr = this.getPara("data");
 			DataService dService = ServiceFactory.getService(DataService.class);
-	        String aesEncryptStr3 = dService.getExamList(this.getPara("data"));
-			this.renderText(aesEncryptStr);
+	        String aesEncryptStr3 = dService.getExamList("Q1R3PhZX3/h9Mue5L5kmugNrt6aBECHKdcdq/q5xBsJVSC5mnenePI5LLZ4GigdpH2RUv/NHX1Kjhnzt1eQpYBgGS5t9Ki63Vc5E/R3T6TnrXfPyeIv1K+HgaCai3sc0");
+			this.renderText(aesEncryptStr3);
 		} catch (Exception e) {
 			// TODO: handle exception
 			this.renderText(e.toString());
@@ -84,8 +82,8 @@ public class ViewController extends Controller {
 	
 	public void testConn3() {
 		DataService dService = ServiceFactory.getService(DataService.class);
-		dService.updateCloudKey();
-		renderNull();
+//		dService.updateCloudKey();
+		renderText(dService.getCloudKey());
 	}
 	
 	public static DruidPlugin createConnectedDruidPlugin() {

+ 6 - 2
DataFusion/src/com/zskk/service/DataService.java

@@ -114,14 +114,18 @@ public class DataService {
         //解密云端数据
         JSONObject jsonObject = JSON.parseObject(content);
         String aesDecodeSt = "";
+        String aesEncryptStr = "";
 		try {
 			aesDecodeSt = AESUtils.aesDecodeStr(jsonObject.getString("data"), getCloudKey() ,IV);
+		
+		//加密为内网密文
+			aesEncryptStr = AESUtils.aesEncryptStr(aesDecodeSt, PropKit.get("nw_key"),IV);
 		} catch (Exception e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
+			return e.toString();
+
 		}
-		//加密为内网密文
-        String aesEncryptStr = AESUtils.aesEncryptStr(aesDecodeSt, PropKit.get("nw_key"),IV);
 		return aesEncryptStr;
 
 	}

+ 2 - 2
DataFusion/src/com/zskk/tools/AESUtils.java

@@ -166,12 +166,12 @@ public class AESUtils {
         //默认向量常量
         String IV = "0000000000000000";
         //密匙
-        String pkey = "1735b0f1799eb3d40ad6fda6692e23e1";
+        String pkey = "2c1db8e7eee65eeeebacb0afbec37096";
         System.out.println("待加密报文:" + content);
         System.out.println("密匙:" + pkey);
         String aesEncryptStr = AESUtils.aesEncryptStr(content, pkey,IV);
         System.out.println("加密报文:" + aesEncryptStr);
-        String aesDecodeStr = AESUtils.aesDecodeStr(aesEncryptStr, pkey,IV);
+        String aesDecodeStr = AESUtils.aesDecodeStr("MEMyZ7e2Ik6s7Harg0Riiwzcmr2eprWIrLX9B75A9Znem3aeLsp0Q91m8/x0LjxTp2qdrVR5ka63rIH5qpdNQeTba1CABN4uzKVjZMNx0x6Xdw8+zTGsvIxTCjvawNnGNRO0Xtlhi+DOkSs4LZtgeiaR2XEX1a2qlwxjJZj9/368dS+C2EuaG8HxvYCqA+0yDE1eJeXbenUg7JRMUdA7LKFl1uFbhWalCV4zal4A6kefmGQKdpSdQDu5MDkjaWOto8jdo9cmEtnHN1s2KvFjk6hTkFnwnPs+BnHSCIyFZ4wmH8IU4pQPQvEx6iMNr+fBVP5rV+Wb82K2cnl2ofxMseuBcpgQ5wefiaJwiUEzuaSbg70/ZR9HHtx050n3eAYoU/DQzOZKt/b2YNV+Ya/r4zTq19V7CsSRRumjgSY4XWzEr+LoUTEIxCC243cEzdCSl1OW+Gz26QDVZmLM6TA8ecX0CHeq6uXk7xJOAmlsgnNqi3Rreec9XB4zfz0Gl4E0b0CyshduKxpAcPRHQmfUfb4IVXsDiJSLIWTwN/dF/h5Ys8BRJeiV5+54Fa5Il1G1pEkiFIcEuRjfoEDhTaiQVis1VrePrZIB7eibv2zB/Z26Q+EoEP++l1dItqV5Oq79sCDhP8bNu0c9eo7aguVs/RDThYqerQfZ6h3UZV93Zv4=", pkey,IV);
         System.out.println("解密报文:" + aesDecodeStr);
         System.out.println("加解密前后内容是否相等:" + aesDecodeStr.equals(content));
     }