PHPackages                             muffin/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. [Security](/categories/security)
4. /
5. muffin/crypt

ActiveCakephp-plugin[Security](/categories/security)

muffin/crypt
============

0.1.0(8y ago)58055MITPHP

Since Jan 16Pushed 8y ago2 watchersCompare

[ Source](https://github.com/UseMuffin/Crypt)[ Packagist](https://packagist.org/packages/muffin/crypt)[ Docs](https://github.com/usemuffin/crypt)[ RSS](/packages/muffin-crypt/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (4)Used By (0)

Crypt
=====

[](#crypt)

[![Build Status](https://camo.githubusercontent.com/160f1f1ac8ca700d092d24940334af301da1af4b54dd48b02840df0461180b5d/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f5573654d756666696e2f43727970742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/UseMuffin/Crypt)[![Coverage](https://camo.githubusercontent.com/8e014872714c5fae7b548b9c0c9f143e0b24ba46dcc8e6baefba241f4500878f/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f5573654d756666696e2f43727970742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/github/UseMuffin/Crypt)[![Total Downloads](https://camo.githubusercontent.com/0c7bf89680deea6c8157a42ee6949173c55078945238f3a3f80c7e771246fda5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d756666696e2f63727970742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/muffin/crypt)[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE)

CakePHP 3 behavior to allow (a)symmetric encryption/decryption of data by the ORM.

Special thanks to security experts [@ircmaxell](https://twitter.com/ircmaxell) &amp; [@voodooKobra](https://twitter.com/voodooKobra) for [reviewing the work](https://twitter.com/jadb/status/688422888152657920).

**USE AT YOUR OWN RISK.**

Install
-------

[](#install)

Using [Composer](http://getcomposer.org):

```
composer require muffin/crypt

```

You then need to load the plugin. You can use the shell command:

```
bin/cake plugin load Muffin/Crypt

```

or by manually adding statement shown below to `bootstrap.php`:

```
Plugin::load('Muffin/Crypt');
```

Usage
-----

[](#usage)

By default, the behavior will use the `Cake\Utility\Security` and not decrypt every find operation. Both configuration could be overridden when setting up the behavior:

```
$this->addBehavior('Muffin/Crypt.Crypt', [
    'fields' => ['cc_number', 'cc_cvv'],
    'strategy' => '\Muffin\Crypt\Model\Behavior\Strategy\AsymmetricStrategy',
    'implementedEvents' => [
        'Model.beforeSave' => 'beforeSave',
        'Model.beforeFind' => 'beforeFind',
    ]
]);
```

If the fields you are encrypting are of a specific type (i.e. `POINT`), and if specified when configuring the behavior, the behavior will take care of transforming the data back and forth. If using a custom type, make sure it is added to your table.

```
$this->addBehavior('Muffin/Crypt.Crypt', [
    'fields' => ['location' => 'point'],
]);
```

Patches &amp; Features
----------------------

[](#patches--features)

- Fork
- Mod, fix
- Test - this is important, so it's not unintentionally broken
- Commit - do not mess with license, todo, version, etc. (if you do change any, bump them into commits of their own that I can ignore when I pull)
- Pull request - bonus point for topic branches

To ensure your PRs are considered for upstream, you MUST follow the [CakePHP coding standards](http://book.cakephp.org/3.0/en/contributing/cakephp-coding-conventions.html).

Bugs &amp; Feedback
-------------------

[](#bugs--feedback)

License
-------

[](#license)

Copyright (c) 2017, [Use Muffin](http://usemuffin.com) and licensed under [The MIT License](http://www.opensource.org/licenses/mit-license.php).

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

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

3212d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ccb57ae849b67ade8d9c1e266bc2868183bbcf07fb6c66c2d45254a452272d54?d=identicon)[jadb](/maintainers/jadb)

![](https://www.gravatar.com/avatar/e31753bdd616948c7c8978ea9b5805378f75bfa62564e69c0aa2fd67aaf418c5?d=identicon)[ADmad](/maintainers/ADmad)

---

Top Contributors

[![ADmad](https://avatars.githubusercontent.com/u/142658?v=4)](https://github.com/ADmad "ADmad (11 commits)")[![shoesole](https://avatars.githubusercontent.com/u/1081633?v=4)](https://github.com/shoesole "shoesole (2 commits)")

---

Tags

cryptographyencryptioncakephpencryptdecryptciphercryptmuffin

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k170.7M239](/packages/defuse-php-encryption)[paragonie/ciphersweet

Searchable field-level encryption library for relational databases

4671.3M23](/packages/paragonie-ciphersweet)[xxtea/xxtea

XXTEA is a fast and secure encryption algorithm. This is a XXTEA library for PHP.

11342.6k](/packages/xxtea-xxtea)[nzo/url-encryptor-bundle

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

951.1M2](/packages/nzo-url-encryptor-bundle)[poly-crypto/poly-crypto

High-level cryptographic functions that are interoperable between NodeJS and PHP 7.1+

128.1k1](/packages/poly-crypto-poly-crypto)[miladrahimi/phpcrypt

Encryption, decryption, and hashing tools for PHP projects

3074.2k2](/packages/miladrahimi-phpcrypt)

PHPackages © 2026

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