PHPackages                             lancerhe/php-crypt - 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. lancerhe/php-crypt

ActiveLibrary

lancerhe/php-crypt
==================

PHP encryption class library

v1.1.0(9y ago)22203PHPPHP &gt;=5.3.0

Since Aug 25Pushed 9y ago1 watchersCompare

[ Source](https://github.com/lancerhe/php-crypt)[ Packagist](https://packagist.org/packages/lancerhe/php-crypt)[ RSS](/packages/lancerhe-php-crypt/feed)WikiDiscussions master Synced 1mo ago

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

PHP Crypt
=========

[](#php-crypt)

[![Latest Stable Version](https://camo.githubusercontent.com/4e107fb1c2ab83e3850477a18745e6bf83beaaf141d3855706ef41450eeb3e49/68747470733a2f2f706f7365722e707567782e6f72672f6c616e63657268652f7068702d63727970742f762f737461626c65)](https://packagist.org/packages/lancerhe/php-crypt) [![Total Downloads](https://camo.githubusercontent.com/4f36e646dbb4e2e2ae6f3d864bb5b25c6420acf017e5e4de259b451f19cd270d/68747470733a2f2f706f7365722e707567782e6f72672f6c616e63657268652f7068702d63727970742f646f776e6c6f616473)](https://packagist.org/packages/lancerhe/php-crypt) [![Latest Unstable Version](https://camo.githubusercontent.com/797032cfd0fd9121d50637e318276386d9ddd2604b16fa7e2b5cb276c8b3850d/68747470733a2f2f706f7365722e707567782e6f72672f6c616e63657268652f7068702d63727970742f762f756e737461626c65)](https://packagist.org/packages/lancerhe/php-crypt) [![License](https://camo.githubusercontent.com/ff6c30033433a3040b623fee7d7cccfdc0b7b65a0f66af24816870863db18325/68747470733a2f2f706f7365722e707567782e6f72672f6c616e63657268652f7068702d63727970742f6c6963656e7365)](https://packagist.org/packages/lancerhe/php-crypt)

Crypt for AES, RSA, 3DES and some special algorithms.

Requirements
------------

[](#requirements)

**PHP5.3.0 or later**

Installation
------------

[](#installation)

Create or modify your composer.json

```
{
    "require": {
        "lancerhe/php-crypt": "1.1.0"
    }
}

```

Usage
-----

[](#usage)

AES

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

$key     = 'nh9a6d2b6s6g9ynh';
$iv      = 'ddky2235gee1g3mr';
$source  = 'my message';
$crypt   = new \LancerHe\Crypt\AES();
$encrypt = $crypt->encrypt($source, $key, $iv);
var_dump($encrypt);    // S5r5uy5zA7yTGIMj0rk68A==
$decrypt = $crypt->decrypt($encrypt, $key, $iv);
var_dump($source);     // my message

```

3DES

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

$key     = '6d2b6s6g';
$iv      = '2235gee1';
$source  = 'my message';
$crypt   = new \LancerHe\Crypt\TripleDES();
$encrypt = $crypt->encrypt($source, $key, $iv);
var_dump($encrypt);    // JPZDDBXGOXZc949A+ggNlA==
$decrypt = $crypt->decrypt($encrypt, $key, $iv);
var_dump($source);     // my message

```

RSA

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

$crypt   = new \LancerHe\Crypt\RSA('/tmp/');
$encrypt = $crypt->pubEncrypt('new message');
var_dump($encrypt);  // rand base64_encode
$decrypt = $crypt->privDecrypt($encrypt);
var_dump($decrypt);  // new message

```

Id

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

$crypt   = new \LancerHe\Crypt\Id();
$encrypt = $crypt->encrypt(23123123);
var_dump($encrypt); // w6lt46urq
$decrypt = $crypt->decrypt($encrypt);
var_dump($encrypt); // 23123123

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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 ~361 days

Total

2

Last Release

3558d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/150764812645aea7e9ac7e78774191f1eb399463038812ac22760095cb736bb2?d=identicon)[lancerhe](/maintainers/lancerhe)

---

Top Contributors

[![lancerhe](https://avatars.githubusercontent.com/u/3190175?v=4)](https://github.com/lancerhe "lancerhe (15 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lancerhe-php-crypt/health.svg)

```
[![Health](https://phpackages.com/badges/lancerhe-php-crypt/health.svg)](https://phpackages.com/packages/lancerhe-php-crypt)
```

PHPackages © 2026

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