Skip to content

Commit

Permalink
update reference
Browse files Browse the repository at this point in the history
  • Loading branch information
emmansun authored Apr 28, 2024
1 parent 313716e commit c6ffa88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
- SM2 certificate parse and verify signature, test CA & certificate are generated from https://www.gmcert.org/
- Parse SM2 private key in PKCS8 format (both encrypted and plaintext).

For usage, please reference [sm2_test.js](https://github.com/emmansun/sm2js/blob/master/src/sm2_test.js "sm2_test.js")
For usage, please reference [sm2_test.js](https://github.com/emmansun/sm2js/blob/master/test/sm2_test.js "sm2_test.js")

## SM3
**SM3**使用比较简单,请参考[cryptojs_sm3_test.js](https://github.com/emmansun/sm2js/blob/master/src/cryptojs_sm3_test.js "cryptojs_sm3_test.js")。单独的**SM3**实现,可以参考[gmsm-sm3js](https://github.com/emmansun/sm3js)
**SM3**使用比较简单,请参考[cryptojs_sm3_test.js](https://github.com/emmansun/sm2js/blob/master/test/cryptojs_sm3_test.js "cryptojs_sm3_test.js")。单独的**SM3**实现,可以参考[gmsm-sm3js](https://github.com/emmansun/sm3js)

## SM4
[jsrsasign](https://github.com/kjur/jsrsasign) 内嵌了[crypto-js](https://github.com/brix/crypto-js)的剪裁版本,只支持默认的**CBC**模式和**PKCS7填充**模式(本实现为了测试,添加了ECB模式和无填充填充模式)。本**SM4**实现同时实现了[sjcl](https://github.com/bitwiseshiftleft/sjcl)所需方法,所以可以和sjcl支持的加密模式一起使用。具体使用方法,请参考[cryptojs_sm4_test.js](https://github.com/emmansun/sm2js/blob/master/src/cryptojs_sm4_test.js "cryptojs_sm4_test.js")。当然,把本**SM4**实现和独立的[crypto-js](https://github.com/brix/crypto-js)结合使用也是可以的。
[jsrsasign](https://github.com/kjur/jsrsasign) 内嵌了[crypto-js](https://github.com/brix/crypto-js)的剪裁版本,只支持默认的**CBC**模式和**PKCS7填充**模式(本实现为了测试,添加了ECB模式和无填充填充模式)。本**SM4**实现同时实现了[sjcl](https://github.com/bitwiseshiftleft/sjcl)所需方法,所以可以和sjcl支持的加密模式一起使用。具体使用方法,请参考[cryptojs_sm4_test.js](https://github.com/emmansun/sm2js/blob/master/test/cryptojs_sm4_test.js "cryptojs_sm4_test.js")。当然,把本**SM4**实现和独立的[crypto-js](https://github.com/brix/crypto-js)结合使用也是可以的。

在NodeJS环境下,修改过的```KJUR.crypto.Cipher.encrypt``````KJUR.crypto.Cipher.decrypt```会优先使用NodeJS Native实现,这两个方法目前只支持以下模式:
- aes128-CBC
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gmsm-sm2js",
"version": "0.7.0",
"version": "0.7.1",
"description": "Pure Javascript implementation of the SM2/SM3/SM4 functions based on jsrsasign",
"keywords": [
"sm2",
Expand Down

0 comments on commit c6ffa88

Please sign in to comment.