PHPackages                             dev-fighters/php-crypter - 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. dev-fighters/php-crypter

ActiveLibrary[Security](/categories/security)

dev-fighters/php-crypter
========================

Crypter for PHP

1.0.8(2y ago)018MITPHPPHP &gt;=8.2

Since Oct 17Pushed 2y agoCompare

[ Source](https://github.com/DevFighters/php-crypter)[ Packagist](https://packagist.org/packages/dev-fighters/php-crypter)[ RSS](/packages/dev-fighters-php-crypter/feed)WikiDiscussions production Synced 1mo ago

READMEChangelogDependencies (1)Versions (10)Used By (0)

DEV FIGHTERS - PHP - Crypter
============================

[](#dev-fighters---php---crypter)

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

[](#installation)

- Install with composer ```
    composer require dev-fighters/php-crypter

    ```
- Requires PHP &gt;= 8.2
- Encryption algorithm is **AEAD XChaCha20 Poly1305 IETF**

How to use
----------

[](#how-to-use)

Main file is `\DF\Encryption\Crypter`

1. Generate a key : the key needs to be saved, or you can't decrypt further.

```
    $key = Crypter::generateKey()
```

2. Encrypt

```
    $key = **KEY_GENERATED**
    $text = **TEXT_TO_ENCRYPT**
    $crypter = new Crypter($key);
    $encryptedText = $crypter->encrypt($text);
```

3. Decrypt

```
    $key = **KEY_GENERATED**
    $textEncrypted = **TEXT_TO_DECRYPT**
    $crypter = new Crypter($key);
    $encryptedText = $crypter->decrypt($textEncrypted);
```

- Additional : check if a string is encrypted or not

```
    $key = **KEY_GENERATED**
    $text = **TEXT_TO_DECRYPT**
    $crypter = new Crypter($key);

    $crypter->isEncrypted($text);
    $crypter->isNotEncrypted($text);
```

All functions accessible
------------------------

[](#all-functions-accessible)

```
    static function generateKey() : string;

    function encrypt(string $textToEncrypt) : string;
    function decrypt(string $textEncrypted) : string;

    function isEncrypted(string $textEncrypted) : bool;
    function isNotEncrypted(string $textEncrypted) : bool;
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

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

Total

9

Last Release

943d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c005ee26d37b4f0612d419159d1eea4d889c0517baeff9390dbbe31b6fe2acf?d=identicon)[df-romain-francois](/maintainers/df-romain-francois)

---

Top Contributors

[![df-romain-francois](https://avatars.githubusercontent.com/u/136347231?v=4)](https://github.com/df-romain-francois "df-romain-francois (10 commits)")

---

Tags

phpencryptiondecryptChaCha20Poly1305cryptsodiumdecryption

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dev-fighters-php-crypter/health.svg)

```
[![Health](https://phpackages.com/badges/dev-fighters-php-crypter/health.svg)](https://phpackages.com/packages/dev-fighters-php-crypter)
```

###  Alternatives

[poly-crypto/poly-crypto

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

127.8k1](/packages/poly-crypto-poly-crypto)

PHPackages © 2026

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