PHPackages                             maker-phper/sm4ecb - 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. maker-phper/sm4ecb

ActiveLibrary[Security](/categories/security)

maker-phper/sm4ecb
==================

sm4ecb for php5.6. An encryption and decryption method.

v1.0(4y ago)31402[1 issues](https://github.com/maker-phper/php-SM4-ECB/issues)MITPHPPHP &gt;=5.6

Since Oct 29Pushed 4y ago2 watchersCompare

[ Source](https://github.com/maker-phper/php-SM4-ECB)[ Packagist](https://packagist.org/packages/maker-phper/sm4ecb)[ RSS](/packages/maker-phper-sm4ecb/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

php-SM4-ECB
===========

[](#php-sm4-ecb)

SM4-ECB for php5.6.27
---------------------

[](#sm4-ecb-for-php5627)

工作需要与Java对接国密SM4-ECB，由于生产环境是32位php5.6，苦于网上找不到对的轮子，所以按照Java的示例程序实现了一个

---

**需要安装GMP拓展**

---

使用方法

`composer require maker-phper/sm4ecb`

```
require dirname(__FILE__) . '/vendor/autoload.php';

$sm4 = new \Sm4ecb\SM4();

$key = 'FECDD61C0BB7C1E291663BE11AA8106A';
$str = "测试urlaaaaaaaa";

$sm4->SetKey($key);
$backData = $sm4->Encrypt($str);
$data = $sm4->Decrypt($backData);
var_dump($backData) ;
echo "";
var_dump($data) ;

```

性能不是很好，有空优化一下 希望能帮助到你

有一份光，发一份热

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

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

Unknown

Total

1

Last Release

1661d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/afc6c6a0e53cc5dcc59e466da05b8c09000741435e9bba43771215ad0c76801c?d=identicon)[maker-phper](/maintainers/maker-phper)

---

Top Contributors

[![maker-phper](https://avatars.githubusercontent.com/u/47819740?v=4)](https://github.com/maker-phper "maker-phper (19 commits)")

---

Tags

php56ECBsm4

### Embed Badge

![Health badge](/badges/maker-phper-sm4ecb/health.svg)

```
[![Health](https://phpackages.com/badges/maker-phper-sm4ecb/health.svg)](https://phpackages.com/packages/maker-phper-sm4ecb)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)

PHPackages © 2026

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