PHPackages                             tuhin18003/simpler-php-encrypt-decrypt - 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. tuhin18003/simpler-php-encrypt-decrypt

ActiveLibrary[Security](/categories/security)

tuhin18003/simpler-php-encrypt-decrypt
======================================

Very handy and simpler PHP Encryption and Decryption

v1.0.1(1y ago)0611↓61%1MITPHPPHP &gt;=7.2.5

Since Jan 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/tuhin18003/simpler-php-encrypt-decrypt)[ Packagist](https://packagist.org/packages/tuhin18003/simpler-php-encrypt-decrypt)[ Docs](https://github.com/tuhin18003/simpler-php-encrypt-decrypt)[ RSS](/packages/tuhin18003-simpler-php-encrypt-decrypt/feed)WikiDiscussions master Synced 2d ago

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

Simpler PHP Encrypt &amp; Decrypt
=================================

[](#simpler-php-encrypt--decrypt)

Very handy and simpler PHP Encryption and Decryption

Install
-------

[](#install)

Via Composer

```
$ composer require tuhin18003/simpler-php-encrypt-decrypt
```

Usage
-----

[](#usage)

Include the autoload file in your working file..

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

```

Encryption
----------

[](#encryption)

```
use Tuhin18003\SimPhpEnDecrypt\Builder;

$encryption = Builder::encrypt('test');

```

Output
------

[](#output)

It returns an array with cipher and key

```
Array ( [cipher] => SWlPb2ZQN1ZDRlJXb2JwRXdOVmtmZz09 [key] => MTk2OGEyOTdlE0M2RkMjhkZGRlOTQxMTk= )

```

Decryption
----------

[](#decryption)

```
use Tuhin18003\SimPhpEnDecrypt\Builder;

Builder::decrypt( $encryption['cipher'], $encryption['key'] );

```

Output
------

[](#output-1)

It returns the original string

```
test

```

### Production - Different approach

[](#production---different-approach)

Get the encrypted and decrypted string without handling the Cipher and Key

Encryption
----------

[](#encryption-1)

You can use your own joiner in advance or leave the second parameter of the function blank. This will make your string more secure.

```
use Tuhin18003\SimPhpEnDecrypt\Builder;

$encryptedToken = Builder::getEncryptedToken('test', "__");

```

Without joiner:

```
use Tuhin18003\SimPhpEnDecrypt\Builder;

$encryption = Builder::getEncryptedToken('test');

```

Output
------

[](#output-2)

It returns a encrypted token

```
aDhaRFZjK2Z1WWlQa1NkSnRINXJMaE85TnhBT2tTQWxTaDJ1eHdmeVl3MD0=__MjkyMjA4MzBhYWZkY2YyNjYyYzU0YWQ2Y2VkMjJkZjI0YTcyMGFjM2QxMDdhZTc3NzA2MGFjOGRhZDA3MTc0OV9fX2Q2NzEwNzc0OWE0MmU4NDI=

```

Decryption
----------

[](#decryption-1)

if you have used your custom joiner, please use it here again

```
use Tuhin18003\SimPhpEnDecrypt\Builder;

Builder::getDecryptedToken( $encryptedToken, "__");

```

Or keep blank the second parameter

```
use Tuhin18003\SimPhpEnDecrypt\Builder;

Builder::getDecryptedToken( $encryptedToken );

```

Output
------

[](#output-3)

It returns the original string

```
test

```

### Credentials

[](#credentials)

- *Created by - [M.Tuhin](https://codesolz.net/)*

[ ![codesolz.net](https://camo.githubusercontent.com/ab5e0b864cdcb589035804867cb5924d7d8985f8a0aa75a8e9a54eff4feaa5b5/68747470733a2f2f7374617469632e636f6465736f6c7a2e6e65742f63732f6c6f676f2e77656270)](https://codesolz.net)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

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

Total

2

Last Release

551d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d3ca97c3d8c9f5c5e46763ff130c96b5b5deafc3d2c41ce78d19ad50fda3b9c?d=identicon)[tuhin18003](/maintainers/tuhin18003)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/tuhin18003-simpler-php-encrypt-decrypt/health.svg)

```
[![Health](https://phpackages.com/badges/tuhin18003-simpler-php-encrypt-decrypt/health.svg)](https://phpackages.com/packages/tuhin18003-simpler-php-encrypt-decrypt)
```

###  Alternatives

[mews/purifier

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

2.0k18.7M143](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24820.0k37](/packages/paragonie-ecc)

PHPackages © 2026

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