PHPackages                             meirtin/crypton - 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. meirtin/crypton

ActiveLibrary[Security](/categories/security)

meirtin/crypton
===============

Laravel API Request Response Encryption

4.1.1(4y ago)1173MITPHPPHP ^7.4|^8.0

Since Jan 22Pushed 4y agoCompare

[ Source](https://github.com/meirtin/crypton)[ Packagist](https://packagist.org/packages/meirtin/crypton)[ Docs](https://github.com/meirtin/crypton)[ Fund](https://paypal.me/KMAhmed)[ GitHub Sponsors](https://github.com/tzsk)[ RSS](/packages/meirtin-crypton/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (9)Versions (15)Used By (0)

🎁 Laravel Crypton
=================

[](#gift-laravel-crypton)

[![Crypton Cover Image](resources/crypton.svg)](resources/crypton.svg)

[![GitHub License](https://camo.githubusercontent.com/81731168ed79c35066811db53b65d12129cffb2adc5d6745f393e2ef5e00a74f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f747a736b2f63727970746f6e3f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/81731168ed79c35066811db53b65d12129cffb2adc5d6745f393e2ef5e00a74f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f747a736b2f63727970746f6e3f7374796c653d666f722d7468652d6261646765)[![Latest Version on Packagist](https://camo.githubusercontent.com/cbd3d88ab53d303de27fcfb3550ca4e13a9abe19e7fbaafa8a24242076af9cba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f747a736b2f63727970746f6e2e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d636f6d706f736572)](https://packagist.org/packages/tzsk/crypton)[![GitHub Tests Action Status](https://camo.githubusercontent.com/20201737e83b4ce6825da22a69cc164a3693a9b677b43c3a87c4e70a772e15ba/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f747a736b2f63727970746f6e2f54657374733f6c6162656c3d7465737473267374796c653d666f722d7468652d6261646765266c6f676f3d676974687562)](https://github.com/tzsk/crypton/actions?query=workflow%3ATests+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/dbc87065206f50e2e376db398a888305cf16a0ca1250513b75a5f474a09b1b7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f747a736b2f63727970746f6e2e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d6c61726176656c)](https://packagist.org/packages/tzsk/crypton)

TThis is a simple package for laravel to encrypt decrypt api request &amp; response in both ends, Backend &amp; Javascript.

📦 Installation
--------------

[](#package-installation)

Via Composer

```
$ composer require tzsk/crypton
```

Publish config file

```
$ php artisan crypton:publish
```

Add an environment variable in the `.env` file

```
CRYPTON_KEY=your-encryption-key
```

👀 Keep in Mind
--------------

[](#eyes-keep-in-mind)

> **TIP:** You can easily generate an encryption key by running `php artisan key:generate` then copy the generated key. Then again run: `php artisan key:generate` to make the key used by crypton and the default application key different.

**WARNING: DO NOT USE THE SAME `APP_KEY` AND `CRYPTON_KEY`**

🔥 Usage
-------

[](#fire-usage)

Start off by adding a Middleware in the `app/Http/Kernel.php` file.

```
$routeMiddleware = [
    'crypton' => \Tzsk\Crypton\Middleware\EncryptRequestResponse::class,
];
```

Now, add this middleware to any api routes or groups.

Example:

```
Route::middleware('crypton')->post('some-endpoint', function(Request $request) {
    return Post::paginate($request->per_page ? : 10);
});
```

That's it.

### 😍 Javascript adapter

[](#heart_eyes-javascript-adapter)

[See Laravel Crypton](https://github.com/tzsk/laravel-crypton)

🔬 Testing
---------

[](#microscope-testing)

```
composer test
```

📅 Changelog
-----------

[](#date-changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

👑 Contributing
--------------

[](#crown-contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

🔒 Security Vulnerabilities
--------------------------

[](#lock-security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

❤️ Credits
----------

[](#heart-credits)

- [Kazi Ahmed](https://github.com/tzsk)
- [All Contributors](../../contributors)

👮‍♂️ License
------------

[](#policeman-license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 63.5% 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 ~138 days

Recently: every ~113 days

Total

9

Last Release

1555d ago

Major Versions

1.0.0 → 2.0.02019-09-28

2.0.0 → 3.0.02020-03-06

3.0.0 → 4.0.02020-09-22

PHP version history (3 changes)2.0.0PHP ^7.2

4.0.0PHP ^7.4

v4.0.2PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4452179ca877727b176821bb18f553ecd08d8492af9db5fbf2905230b4c94d19?d=identicon)[meirtin](/maintainers/meirtin)

---

Top Contributors

[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (80 commits)")[![tzsk](https://avatars.githubusercontent.com/u/13273787?v=4)](https://github.com/tzsk "tzsk (42 commits)")[![meirtin](https://avatars.githubusercontent.com/u/5532778?v=4)](https://github.com/meirtin "meirtin (4 commits)")

---

Tags

Cryptonlaravel request encryptlaravel response encryptmeirtin

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/meirtin-crypton/health.svg)

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

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M531](/packages/laravel-passport)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[tzsk/crypton

Laravel API Request Response Encryption

417.1k](/packages/tzsk-crypton)[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[spatie/laravel-export

Create a static site bundle from a Laravel app

646127.9k5](/packages/spatie-laravel-export)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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