Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lpilp authored Dec 10, 2021
1 parent 3e8c39d commit 7fd31dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# php sm2 sm3 sm4 国密算法整理
* php版本的国密sm2的签名算法(暂不支持非对称加解密),sm3的hash, sm4的对称加解密,要求PHP7,打开gmp支持
* php版本的国密sm2的签名算法(新版已支持,普通的测试没有问题,不能保证兼容所有的),sm3的hash, sm4的对称加解密,要求PHP7,打开gmp支持
* 目前如果服务器配套的使用的是openssl 1.1.1x, 目前到1.1.1.l(L) ,sm3,sm4都可以直接用openssl_xxx系列函数直接实现,不必大量的代码,但不支持sm2的签名,sm2的加解密
* 有一个sm3, sm4的比较好的代码: https://github.com/lizhichao/sm 可以使用composer安装
* 有一个sm3, sm4的比较好的代码: https://github.com/lizhichao/sm 可以使用composer安装,只是这个的ecb, cbc没有做补齐

### 使用(how to use)
* composer require lpilp/guomi
Expand All @@ -12,6 +12,7 @@
* 参考了 https://github.com/ToAnyWhere/phpsm2 童鞋的sm2验签算法,密钥生成算法
* 添加了签名算法, 支持sm2的16进制,base64公私钥的签名,验签算法
* 支持从文件中读取pem文件的签名,验签算法
* 添加了sm2的非对称加密的算法
* sm2的加密解密算法在openssl 1.1.1的版本下自带的函数中暂无sm2的公钥私钥的加密函数,得自己实现,建议使用C,C++的算法,打包成PHP扩展的方式
* 由于 openssl没有实现sm2withsm3算法,用系统函数无法实现签名及证书的自签名分发

Expand Down

0 comments on commit 7fd31dd

Please # to comment.