首先介紹一下國密算法:
其中SM1、SM4、SM7、祖沖之密碼(ZUC)是對稱算法;SM2、SM9是非對稱算法;SM3是哈希算法。
https://gitee.com/mai12/gmca 這是學習大佬的代碼寫的,結合了GMCA和gmhelper,實現了證書生成,私鑰SM4加密存儲,再次感謝大佬們。
然后是Github和Gitee上找到的開源代碼:
*************************************************************************************************************************************************************************************************
https://github.com/hwyqb/SM2_SM3_SM4Encrypt // 專業,包分的好 127 star 項目中包括SM2算法的加密/解密/簽名/驗簽 , SM3算法的摘要計算 , SM4算法的對稱加密/解密 , 以及相應算法的公私鑰對的生成方法。
https://github.com/ZZMarquis/gmhelper //SM2 X509v3證書的簽發,專業 359 star
https://github.com/wcnwyx/gm-encryption // 國密 SM2 SM3 SM4 算法, 使用的是bouncycastle包 , 18star
https://github.com/dushitaoyuan/littleca //littleca是一個基於BC的小型ca庫,支持ecc,rsa,dsa,sm2的證書簽發,加密,解密,簽名
https://github.com/ziyaofeng/GMCA // 最精簡
https://gitee.com/defaworld/GM_SM23/blob/master/src/main/java/whoever/SM2.java // 學習例子,值得抄寫一次啊
https://gitee.com/zjf2671/hsd-cipher-sm.git // 不錯
*************************************************************************************************************************************************************************************************
