{"id":19596872,"url":"https://github.com/emmansun/sm2js","last_synced_at":"2026-03-18T00:04:19.833Z","repository":{"id":57251503,"uuid":"340284527","full_name":"emmansun/sm2js","owner":"emmansun","description":"GM-Standards SM2 SM3 SM4 for Javascript","archived":false,"fork":false,"pushed_at":"2026-01-19T00:29:32.000Z","size":490,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-19T10:26:29.321Z","etag":null,"topics":["jsrsasign","sm2","sm3","sm4"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emmansun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-19T06:57:32.000Z","updated_at":"2026-01-19T00:29:35.000Z","dependencies_parsed_at":"2024-03-14T04:25:10.303Z","dependency_job_id":"4f2b029f-5c47-441e-86b8-34a2a9e4e71c","html_url":"https://github.com/emmansun/sm2js","commit_stats":{"total_commits":43,"total_committers":4,"mean_commits":10.75,"dds":0.4883720930232558,"last_synced_commit":"fcd43676f7958e9ed1acf93d6bbf658e97b8b9e3"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/emmansun/sm2js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmansun%2Fsm2js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmansun%2Fsm2js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmansun%2Fsm2js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmansun%2Fsm2js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmansun","download_url":"https://codeload.github.com/emmansun/sm2js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmansun%2Fsm2js/sbom","scorecard":{"id":375955,"data":{"date":"2025-08-11","repo":{"name":"github.com/emmansun/sm2js","commit":"96632a73abef47007d8d8481720e66c4ae65e0c1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/24 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/emmansun/sm2js/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/emmansun/sm2js/ci.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T14:14:51.059Z","repository_id":57251503,"created_at":"2025-08-18T14:14:51.059Z","updated_at":"2025-08-18T14:14:51.059Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30636705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T23:56:54.546Z","status":"ssl_error","status_checked_at":"2026-03-17T23:56:28.952Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jsrsasign","sm2","sm3","sm4"],"created_at":"2024-11-11T08:56:58.613Z","updated_at":"2026-03-18T00:04:19.809Z","avatar_url":"https://github.com/emmansun.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sm2js (jsrsasign-sm)\n[![SM2JS CI](https://github.com/emmansun/sm2js/actions/workflows/ci.yml/badge.svg)](https://github.com/emmansun/sm2js/actions/workflows/ci.yml)\n[![npm version](https://badge.fury.io/js/gmsm-sm2js.svg)](https://badge.fury.io/js/gmsm-sm2js)\n[![NPM Downloads][npm-downloads-image]][npm-url]\n\n**sm2js is a pure Javascript implementation of the GM-Standards SM2 (also support sm3/sm4) based on [jsrsasign](https://github.com/kjur/jsrsasign).**\n\n基于jsrsasign实现的优势在于充分利用jsrsasign的PKIX，CSR，CERT，PKCS8等处理能力。您也可以参考另外一个实现：[sjcl-sm](https://github.com/emmansun/sm4js)。\n\n## SM2\n\n- sign/verify functions (Passed integration test with ALI KMS)\n- sm2Sign/sm2Verify functions (include uid and curve related parameters in signature)\n- encrypt/decrypt functions (Passed integration test with ALI KMS), support both PLAIN and ASN.1 encoding format ciphertext output\n- SM2 certificate signing request generation and parse\n- SM2 certificate parse and verify signature, test CA \u0026 certificate are generated from https://www.gmcert.org/\n- Parse SM2 private key in PKCS8 format (both encrypted and plaintext).\n\nFor usage, please reference [sm2_test.js](https://github.com/emmansun/sm2js/blob/master/test/sm2_test.js \"sm2_test.js\")\n\n## SM3\n**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)。\n\n## SM4\n[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)结合使用也是可以的。\n\n在NodeJS环境下，修改过的```KJUR.crypto.Cipher.encrypt```和```KJUR.crypto.Cipher.decrypt```会优先使用NodeJS Native实现，这两个方法目前只支持以下模式：  \n- aes128-CBC\n- aes256-CBC\n- des-EDE3-CBC\n- sm4-CBC\n\n[npm-downloads-image]: https://badgen.net/npm/dm/gmsm-sm2js\n[npm-url]: https://npmjs.org/package/gmsm-sm2js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmansun%2Fsm2js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmansun%2Fsm2js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmansun%2Fsm2js/lists"}