|
@@ -2,6 +2,7 @@ package com.abi.qms.platform;
|
|
|
|
|
|
import cn.hutool.crypto.SecureUtil;
|
|
|
import cn.hutool.crypto.symmetric.AES;
|
|
|
+import com.abi.qms.platform.infrastructure.util.AesEncodeUtil;
|
|
|
import com.abi.task.common.api.exception.BusinessException;
|
|
|
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -31,27 +32,15 @@ public class EncryptionTest {
|
|
|
return encryptDataEncode;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 测试
|
|
|
- *
|
|
|
- * @param args
|
|
|
- * @throws Exception
|
|
|
- */
|
|
|
- public static void main(String[] args) throws Exception {
|
|
|
- System.out.println("开始");
|
|
|
- String sp_jia = "D:\\test\\test+\\100w.txt";//加密后文件
|
|
|
- String sp = "D:\\test\\100w.txt";//原始文件
|
|
|
- String sp_jie = "D:\\test\\test-\\100w.txt";//解密后文件
|
|
|
- String readToString = readToString(sp);//读取文件
|
|
|
- String jiami = encryptAES(readToString, key);
|
|
|
- getFile(jiami, sp_jia);//加密
|
|
|
- System.out.println("写入完毕");
|
|
|
- String readToString_jia = readToString(sp_jia);//读取文件
|
|
|
- String jiemi = jmencryptAES(readToString_jia, key);
|
|
|
- getFile(jiemi, sp_jie);//解密
|
|
|
- System.out.println("完毕");
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ String a = "hwc6davQc6wAsDKz3zIuBQ==";
|
|
|
+ String s = AesEncodeUtil.aesDecode(a, "EC/Z+S7c3EFJa2dtvLyekg==");
|
|
|
+ System.out.println(s);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 写入文件
|
|
|
*
|