# JuneAndGreen/sm-crypto

国密算法js版

Repository: https://github.com/JuneAndGreen/sm-crypto
Canonical: https://ross.abutalabs.com/products/sm-crypto
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2026-08-24T03:58:54+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 35, longevity 100
- inputs: {"age_days": 3140, "days_push": 9, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1159, forks 287 (observed 2026-08-28T04:03:48.984545+00:00)

## What it is
A pure JavaScript implementation of the Chinese national cryptography (Guomi) algorithms SM2 (elliptic curve encryption/signatures), SM3 (hash), and SM4 (block cipher). It runs in Node.js and browsers via npm.

## Use cases
- implement sm2 encryption and decryption in javascript
- generate sm2 key pairs and sign/verify data in the browser
- compute sm3 hash of a string in nodejs
- encrypt data with sm4 block cipher in js
- integrate chinese national standard cryptography into a web app
- verify signatures from a backend that uses guomi algorithms

## When to choose
- you need SM2/SM3/SM4 in JavaScript with no native dependencies
- you must interoperate with Chinese government or financial systems requiring Guomi algorithms
- you want a lightweight, MIT-licensed crypto library usable in both browser and Node.js

## When to avoid
- you need general-purpose cryptography like RSA, AES, or SHA-2
- you require formally audited or FIPS-certified crypto implementations
- you need constant-time guarantees against side-channel attacks in hostile environments

## Facets
- artifact type: library
- maturity: active
- function: cryptography, security
- domain: security, developer-tools, web-development
- platform: browser
- tags: sm2, sm3, sm4, chinese-national-cryptography, elliptic-curve, encryption, digital-signature, hash, nodejs, javascript

## Member repositories
- JuneAndGreen/sm-crypto (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:48.984545+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:31:51.537467+00:00, confidence not recorded.
  - readme: https://github.com/JuneAndGreen/sm-crypto (fetched 2026-08-28T04:03:48.984545+00:00, sha 73eadb0c5f0e)
  - registry_npm: https://registry.npmjs.org/sm-crypto (fetched 2026-08-29T12:36:41.528748+00:00, sha 5d0845a42b1a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
