PHPackages                             cexll/hash-encode - 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. cexll/hash-encode

ActiveProject

cexll/hash-encode
=================

hash response body

v0.0.1(5y ago)010Apache-2.0PHPPHP &gt;=7.2

Since Apr 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/cexll/hashEncode)[ Packagist](https://packagist.org/packages/cexll/hash-encode)[ Docs](https://github.com/cexll/hash-encode)[ RSS](/packages/cexll-hash-encode/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

使用 rsa + aes 加密接口数据
===================

[](#使用-rsa--aes-加密接口数据)

安装

```
composer require cexll/hash-encode
```

思路

```
加密
    rsa 用于加密(key) --- 随机生成的key
    aes 用于加密(body) --- 接口数据
    得到
    {
      "body": 加密的数据,
      "key": 加密的key
    }
解密
    rsa 使用公钥解密, 得到随机生成的key
    aes 使用解密到的key, 来解密body 数据, 得到 接口数据
```

```
function hash($data): array
{
    # 设置rsa 公钥 密钥
    hashEncode::setPrivateKeyPath('path');
    #hashEncode::setPublicKeyPath('path'); 这里可以不用公钥地址, 因为只加密不解密

    # 加密
    return hashEncode::hash_encode(json_encode($data, JSON_UNESCAPED_UNICODE));
}
```

得到结果类似

```
{
  "body": "78eqOhxERE2unQRBr4d\/6hGmlDqMofEoZGBt5aPnp3ATRMkGh92z\/zkdNKFW9RkbMx0jShaKJoX+7cMAGkqy\/xn4AbiUjVgl8aNqFqgPEE1PBM+1FImxYcy1zUb25gvhRZ28oRuMAm+9XJ96o7YU4iedy7ZL8PwP22uXQN3BGtrklf\/6coCRfgxKFy2RSJ70rF0trgs47xTRcki8cVruAtMf2KlDTMQwAMXkEfOZEU9nBxfaxoX\/leVRm8L9wxn1y2FUEnS4p5dJN7hmCaTK8Ge++7eVZP7OjOlkSJrzyClp9oRQgDFhAJR6JPoC8yMR1+9hOqRS0ypTxdgEXgsE8eX4sid2qYla\/H98q1oXDxM=",
  "key": "AIxbXOhYR8VCyxldvOUM92IeThudbxjbWWpo9zpVkxjSuI23PkP7qf4BF9qxmUNv1PXpTYUJECym+bQkTvjnMufYWYocBRm2KfiaOuK\/SznFW+tJGEuIG3KftZFud2JFv1ELCdgauLAHnSzyPXQ47at3WE12e8iNJ6moK8q9sJI="
}
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

1864d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/26520956?v=4)[ben](/maintainers/cexll)[@cexll](https://github.com/cexll)

---

Top Contributors

[![cexll](https://avatars.githubusercontent.com/u/26520956?v=4)](https://github.com/cexll "cexll (3 commits)")

---

Tags

phprsaaescrypt

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cexll-hash-encode/health.svg)

```
[![Health](https://phpackages.com/badges/cexll-hash-encode/health.svg)](https://phpackages.com/packages/cexll-hash-encode)
```

###  Alternatives

[miladrahimi/phpcrypt

Encryption, decryption, and hashing tools for PHP projects

3171.5k2](/packages/miladrahimi-phpcrypt)[vlucas/pikirasa

PKI public/private RSA key encryption using the OpenSSL extension

104101.1k1](/packages/vlucas-pikirasa)[ebics-api/ebics-client-php

PHP library to communicate with bank through EBICS protocol.

6411.1k](/packages/ebics-api-ebics-client-php)[poly-crypto/poly-crypto

High-level cryptographic functions that are interoperable between NodeJS and PHP 7.1+

127.8k1](/packages/poly-crypto-poly-crypto)

PHPackages © 2026

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