使用
添加依赖
com.github.gitveio
gmssl-dev
1.0
示例
GmSSL gmSSL = new GmSSL();
// SMS4加解密,替换des..
byte[] key = {1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8};
byte[] iv = {1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8};
byte[] s1 = gmSSL.symmetricEncrypt("SMS4", "1234566".getBytes(), key, iv);
byte[] s2 = gmSSL.symmetricDecrypt("SM
2022-03-31 18:27:00
3.02MB
Java
1