SM4Utils加解密demo

2024-10-09 10:51:50 浏览数 (3)

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

0 人点赞