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

ActiveLibrary[Security](/categories/security)

warwar/crypton
==============

Laravel API Request Response Encryption

4.0.2(1y ago)022MITPHPPHP ^7.4|^8.2

Since Jan 21Pushed 1y agoCompare

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

READMEChangelog (1)Dependencies (9)Versions (2)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

29

—

LowBetter than 59% of packages

Maintenance42

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.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

Unknown

Total

1

Last Release

482d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e68d80a99698f38aff1c84431da053b2dab3c6568861a46b50b79876840e961?d=identicon)[warwar](/maintainers/warwar)

---

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)")[![warwar](https://avatars.githubusercontent.com/u/6747659?v=4)](https://github.com/warwar "warwar (2 commits)")

---

Tags

tzskCryptonlaravel request encryptlaravel response encrypt

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[tzsk/crypton

Laravel API Request Response Encryption

417.1k](/packages/tzsk-crypton)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

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

A secure, database-free One-Time Password (OTP) generator and verifier for PHP and Laravel.

241641.4k1](/packages/tzsk-otp)[spatie/laravel-export

Create a static site bundle from a Laravel app

646127.9k5](/packages/spatie-laravel-export)[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)

PHPackages © 2026

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