PHPackages                             tanghao2018/encryption - 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. tanghao2018/encryption

ActiveLibrary[Security](/categories/security)

tanghao2018/encryption
======================

PHP library to encryption

1.0.0(9y ago)010MITPHPPHP &gt;=5.4.0

Since Jan 30Pushed 9y ago1 watchersCompare

[ Source](https://github.com/rainbow2019s/encryption)[ Packagist](https://packagist.org/packages/tanghao2018/encryption)[ RSS](/packages/tanghao2018-encryption/feed)WikiDiscussions master Synced 2mo ago

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

public function test1() { $str = 'abc';

```
    $key1 = Encryption::encryptCode($str, 60);

    echo $key1;

}

public function test2()
{
    $str = 'bfd759bVSJXltuQ0A3pom3a7pfIkY1IfUk87nIUxH3m0w8';

    //$key1 = Encryption::encryptCode($str, 60);
    $key2 = Encryption::encryptDecode($str, 60);

    echo $key2;
    echo 'ok';
}

public function test3()
{
    $str = 'http://www.163.com';

    $key1 = Encryption::encodeUrl($str);
    echo $key1;
    echo "";
    $key2 = Encryption::decodeUrl($key1);
    echo $key2;
}

public function test4()
{
    $password = '123456';

    $key1 = Encryption::encodePassport($password);
    echo $key1;
    echo "";
    $key2 = Encryption::decodePassport($key1);
    echo $key2;
}

public function test5()
{
    $str = '12345';

    $key1 = Encryption::SHA1($str, true);
    echo $key1;
    echo "";
    $key2 = Encryption::SHA1($key1, false);
    echo $key2;
}

public function test6()
{
    $key = Encryption::random();
    echo $key;
    $str  = 'aaabbb';
    $key1 = Encryption::desEncrypt($str, $key);
    echo $key1;
    echo "";
    $key2 = Encryption::desDecrypt($key1, $key);
    echo $key2;
}

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

3387d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb70e338366eeedfbce4fd5c85dd9973bc5235d22e1688766091c0e5ea7d3a85?d=identicon)[tanghao2018](/maintainers/tanghao2018)

---

Top Contributors

[![rainbow2019s](https://avatars.githubusercontent.com/u/20558112?v=4)](https://github.com/rainbow2019s "rainbow2019s (1 commits)")

### Embed Badge

![Health badge](/badges/tanghao2018-encryption/health.svg)

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

###  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)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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