PHPackages                             ritaswc/sm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. ritaswc/sm

Abandoned → [lizhichao/one-sm](/?search=lizhichao%2Fone-sm)Library[Security](/categories/security)

ritaswc/sm
==========

国密加密算法PHP软件实现版

1.0.1(6y ago)1582MITPHPPHP ^7.0

Since May 25Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ritaswc/sm)[ Packagist](https://packagist.org/packages/ritaswc/sm)[ RSS](/packages/ritaswc-sm/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (3)Used By (0)

国密算法
====

[](#国密算法)

##### 使用方法

[](#使用方法)

```
composer require ritaswc/sm
```

```
$helper = new \Ritaswc\SM\SM4();
echo $helper->encrypt('this is key', 'PHP是世界上最好的语言');
echo "\n";
echo $helper->decrypt('this is key', 'TFK6KUnXe7/DLovioxZvU8G8GwcxXTf93GxR0mMiFts=');
```

##### 结果是

[](#结果是)

```
TFK6KUnXe7/DLovioxZvU8G8GwcxXTf93GxR0mMiFts=
PHP是世界上最好的语言
```

Author
------

[](#author)

- [Charles的小星球](https://blog.yinghualuo.cn)

License
-------

[](#license)

SM is licensed under [MIT](https://github.com/ritaswc/sm/blob/master/LICENSE).

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2275d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d573b192b6e1ea26030ba9b8830fd42baa06eae328898442ef55ac24e5101c4?d=identicon)[ritaswc](/maintainers/ritaswc)

---

Top Contributors

[![ritaswc](https://avatars.githubusercontent.com/u/15887140?v=4)](https://github.com/ritaswc "ritaswc (7 commits)")

### Embed Badge

![Health badge](/badges/ritaswc-sm/health.svg)

```
[![Health](https://phpackages.com/badges/ritaswc-sm/health.svg)](https://phpackages.com/packages/ritaswc-sm)
```

###  Alternatives

[phpids/phpids

PHPIDS (PHP-Intrusion Detection System) is a simple to use, well structured, fast and state-of-the-art security layer for your PHP based web application

791150.0k2](/packages/phpids-phpids)[paragonie/ecc

PHP Elliptic Curve Cryptography library

25866.3k44](/packages/paragonie-ecc)[nicobleiler/php-passphrase

Passphrase generator with Laravel integration, inspired by Bitwarden. Uses the EFF long word list by default with support for custom wordlists.

4912.6k](/packages/nicobleiler-php-passphrase)[dwgebler/encryption

Encryption wrapper for PHP using libsodium — simple API for symmetric and asymmetric encryption, password hashing, digital signing, and message authentication.

317.5k](/packages/dwgebler-encryption)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
