SM4Utils加解密demo

SM4Utils加解密demo

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

 

posted on 2023-04-10 23:09  oktokeep  阅读(430)  评论(0编辑  收藏  举报