PHPackages                             affinity4/cipher - 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. affinity4/cipher

ActiveLibrary[Security](/categories/security)

affinity4/cipher
================

Cipher encrypt/decrypt. Encrypt and decrypt private strings. Useful if you need to store a string as a hash but need to see it as plain text also. DO NOT USE FOR PASSWORD AUTHENTICATION!

2.0.0(4y ago)0372MITPHPPHP &gt;=7.4

Since Apr 7Pushed 4y ago1 watchersCompare

[ Source](https://github.com/affinity4/cipher)[ Packagist](https://packagist.org/packages/affinity4/cipher)[ RSS](/packages/affinity4-cipher/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Affinity4 Cipher
================

[](#affinity4-cipher)

Encrypt and decrypt private strings. Useful if you need to store a string as a hash but need to see it as plain text also.

**DO NOT USE FOR PASSWORD AUTHENTICATION!**

Installation
------------

[](#installation)

### Composer

[](#composer)

```
composer require affinity4/cipher
```

Usage
-----

[](#usage)

```
// Used by both excrypt and decrypt methods, so should be available globally
// Perhaps as an environment variable
$key = 'b1f1e6225cb2b6d0230b16125e45ca63';
$str = 'my secret';

$encrypted = \Affinity4\Cipher\Cipher::encrypt($str, $key); // piqwpeiqep12801aqwie0248quqjowq==
$decrypted = \Affinity4\Cipher\Cipher::decrypt($encrypted, $key); // my secret
```

Licence
-------

[](#licence)

MIT 2018 Luke Watts

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Total

2

Last Release

1497d ago

Major Versions

1.0.0 → 2.0.02022-05-25

PHP version history (2 changes)1.0.0PHP &gt;=5.6

2.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8245712?v=4)[Affinity4](/maintainers/Affinity4)[@affinity4](https://github.com/affinity4)

---

Top Contributors

[![lukewatts](https://avatars.githubusercontent.com/u/4622166?v=4)](https://github.com/lukewatts "lukewatts (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/affinity4-cipher/health.svg)

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

###  Alternatives

[mews/purifier

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

2.0k18.0M138](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

25772.0k36](/packages/paragonie-ecc)

PHPackages © 2026

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