SM4Utils加解密demo
代码语言:javascript复制package com.example.core.mydemo.sm4;
import cn.org.bjca.utils.SM4Utils;
public class SM4Test {
public static void main(String[] args) {
String key = "77rTb25789srfbhulsjwnv==";
String iv = "BPEpTshuwasdbdqwye6fB8==";
String arg = "测试字符串";
String a = cn.org.bjca.utils.SM4Utils.encryptData_CBC(arg, key, iv);
System.out.println(a);
System.out.println(SM4Utils.decryptData_CBC(a, key, iv, false));
}
}
支持的jar支持: BJCA_multi_LOG_1.4.jar BJCA-JCE.jar BJCA-JCE2.jar BJCA-JDOM.jar BJCA-SecX2.7.1.jar
https://files.cnblogs.com/files/oktokeep/sm4.zip?t=1681139610&download=true