PHPackages                             xudongyss/secure - 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. xudongyss/secure

ActiveLibrary[Security](/categories/security)

xudongyss/secure
================

1.0(5y ago)05PHP

Since Dec 9Pushed 5y ago1 watchersCompare

[ Source](https://github.com/xudongyss/secure)[ Packagist](https://packagist.org/packages/xudongyss/secure)[ RSS](/packages/xudongyss-secure/feed)WikiDiscussions master Synced 4d ago

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

加密
==

[](#加密)

\[TOC\]

安装
--

[](#安装)

```
composer require xudongyss/secure

```

快速使用
----

[](#快速使用)

### AES

[](#aes)

#### 初始化

[](#初始化)

```
require_once 'vendor/autoload.php';

use XuDongYss\Secure\AES;

/* 加密密钥 */
$key = 'a6685c701698f59258d4cd09fd6e6033';
/* 加密方式：CBC/CTR/OFB/CFB/ECB */
$mode = 'ECB';
$cipher = new AES($key, $mode);
```

#### 加密

[](#加密-1)

```
$ciphertext = $cipher->encrypt('{"PATH":"\/sbin:\/usr\/sbin:\/bin:\/usr\/bin","LD_LIBRARY_PATH":"\/usr\/local\/apache\/lib:\/usr\/local\/openssl\/lib","PHPRC":"\/usr\/local\/php7\/bin\/php","PHP_FCGI_MAX_REQUESTS":"1000","SCRIPT_NAME":"\/index.php","REQUEST_URI":"\/App\/Team\/Index\/team_list?uid=100000014&password=13fd34605d41452112dc6c7fb2cdd381&language_id=1&p=1","QUERY_STRING":"\/App\/Team\/Index\/team_list&uid=100000014&password=13fd34605d41452112dc6c7fb2cdd381&language_id=1&p=1","REQUEST_METHOD":"GET","SERVER_PROTOCOL":"HTTP\/1.1","GATEWAY_INTERFACE":"CGI\/1.1","REDIRECT_QUERY_STRING":"\/App\/Team\/Index\/team_list&uid=100000014&password=13fd34605d41452112dc6c7fb2cdd381&language_id=1&p=1","REDIRECT_URL":"\/App\/Team\/Index\/team_list","REMOTE_PORT":"23168","SCRIPT_FILENAME":"\/home\/wwwroot\/lingrenwu\/index.php","SERVER_ADMIN":"you@example.com","CONTEXT_DOCUMENT_ROOT":"\/home\/wwwroot\/lingrenwu\/","CONTEXT_PREFIX":"","REQUEST_SCHEME":"http","DOCUMENT_ROOT":"\/home\/wwwroot\/lingrenwu\/","REMOTE_ADDR":"106.57.119.173","SERVER_PORT":"80","SERVER_ADDR":"172.16.156.208","SERVER_NAME":"lingrenwu.cnsunrun.com","SERVER_SOFTWARE":"Apache\/2.4.29 (Unix) OpenSSL\/1.0.2n PHP\/5.6.40 mod_fcgid\/2.3.9","SERVER_SIGNATURE":"","HTTP_COOKIE":"PHPSESSID=1ea7e8d084e90ff3be222591bae37fa0","HTTP_ACCEPT_LANGUAGE":"zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7","HTTP_ACCEPT_ENCODING":"gzip, deflate","HTTP_X_REQUESTED_WITH":"XMLHttpRequest","HTTP_USER_AGENT":"Mozilla\/5.0 (Linux; Android 10; Redmi K30 5G Build\/QKQ1.191222.002; wv) AppleWebKit\/537.36 (KHTML, like Gecko) Version\/4.0 Chrome\/83.0.4103.101 Mobile Safari\/537.36 Html5Plus\/1.0 (Immersed\/34.545456)","HTTP_ACCEPT":"application\/json","HTTP_CONNECTION":"close","HTTP_HOST":"lingrenwu.cnsunrun.com","REDIRECT_STATUS":"200","FCGI_ROLE":"RESPONDER","PHP_SELF":"\/index.php","REQUEST_TIME_FLOAT":1605970289.714683,"REQUEST_TIME":1605970289,"argv":["\/App\/Team\/Index\/team_list&uid=100000014&password=13fd34605d41452112dc6c7fb2cdd381&language_id=1&p=1"],"argc":1,"PATH_INFO":"Team\/Index\/team_list"}');
echo $ciphertext;//base64后的结果
```

#### 解密

[](#解密)

```
$cipher->decrypt($ciphertext);
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

1984d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f89328b21f1a0ff093d7c8df84f784af3cdd9c81c016362a65eb98dac4634fe?d=identicon)[xudongyss](/maintainers/xudongyss)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/xudongyss-secure/health.svg)

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

###  Alternatives

[singpolyma/openpgp-php

Pure-PHP implementation of the OpenPGP Message Format (RFC 4880)

184795.6k10](/packages/singpolyma-openpgp-php)[payu/apple-pay

ApplePay Token Decoder

51983.2k](/packages/payu-apple-pay)[mlocati/ocsp

Library to query HTTPS Certificates revocation status using the Online Certificate Status Protocol (OCSP)

40754.7k2](/packages/mlocati-ocsp)[spatie/ssl-certificate-chain-resolver

SSL certificate chain resolver

3069.6k](/packages/spatie-ssl-certificate-chain-resolver)[camcima/dukpt-php

DUKPT implementation in PHP

25153.1k](/packages/camcima-dukpt-php)

PHPackages © 2026

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