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

ActiveLibrary[Security](/categories/security)

marceleza/crypton
=================

Laravel API Request Response Encryption

00PHP

Since Dec 25Pushed 3y agoCompare

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

READMEChangelogDependenciesVersions (1)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

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/259f104228d8784b84777de3a580ddd3a4aa73e5a7ccbcf8e8cf90ec41407d6f?d=identicon)[omarceleza](/maintainers/omarceleza)

---

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

### Embed Badge

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

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

###  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)
