- 授权协议: Apache
- 开发语言: Java JavaScript
- 操作系统: 跨平台
- 软件首页: http://git.oschina.net/noarm/GuoMiSuanFaSM4-SM3-SM2
- 软件文档: http://git.oschina.net/noarm/GuoMiSuanFaSM4-SM3-SM2
软件介绍
国密算法 SM4 SM3 SM2,JS 版本、JAVA 版本。
var input = "待加密"; var key = "admin#$%^"; //加密 ec = SM4.encode({ input:input, key:key }); console.log('加密:'+ec); //解密 var dc = SM4.decode({ input:ec, key:key }); console.log('解密:'+dc);
public static void main(String[] args) throws IOException { String s = new SM4().encode("待加密", "admin#$%^"); System.out.println(s); String j = new SM4().decode(s, "admin#$%^"); System.out.println(j); }