PHPackages                             gwsn/php-encrypt - 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. gwsn/php-encrypt

ActiveLibrary[Security](/categories/security)

gwsn/php-encrypt
================

Simple helpers for encrypt and decrypt content

1.0.0(4y ago)116.1k↓47.8%MITPHPPHP ^7.4 || ^8.0

Since Apr 4Pushed 4y ago1 watchersCompare

[ Source](https://github.com/gwsn/php-encrypt)[ Packagist](https://packagist.org/packages/gwsn/php-encrypt)[ Docs](https://github.com/gwsn/php-encrypt)[ RSS](/packages/gwsn-php-encrypt/feed)WikiDiscussions main Synced 1mo ago

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

PHP Encrypt/Decrypt content tooling
===================================

[](#php-encryptdecrypt-content-tooling)

Simple tooling to encrypt and decrypt content

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

[](#installation)

You can install the package via composer:

```
composer require gwsn/php-encrypt
```

Plain Usage
-----------

[](#plain-usage)

```
use GWSN/Encrypt/Encryptor;

$encryptor = new Encryptor('secretKey');

$encrypted = $encryptor->encrypt('content');

$decrypted = $encryptor->decrypt($encrypted);
```

Use in Symfony
--------------

[](#use-in-symfony)

Add the following part to the `config/services.yaml`

- Where the kernel.secret should be set and a valid string of 32 characters, alternative you can set a random secret key

```
GWSN\Encrypt\Encryptor:
  arguments:
    $secretKey: '%kernel.secret%'
```

And you can use it in any function with dependency injection

```
    private Encryptor $encryptor;

    public function __construct(Encryptor $encryptor)
    {
        $this->encryptor = $encryptor;
    }

    public function makeItSecret(string $content): string
    {
        return $this->encryptor->encrypt($content);
    }

    public function makeItReadable(string $content): string
    {
        return $this->encryptor->decrypt($content);
    }
```

Test
----

[](#test)

```
composer run test
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1506d ago

### Community

Maintainers

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

---

Top Contributors

[![jnovermars](https://avatars.githubusercontent.com/u/4355811?v=4)](https://github.com/jnovermars "jnovermars (2 commits)")

---

Tags

packageencryptdecryptsodiumgwsn

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gwsn-php-encrypt/health.svg)

```
[![Health](https://phpackages.com/badges/gwsn-php-encrypt/health.svg)](https://phpackages.com/packages/gwsn-php-encrypt)
```

###  Alternatives

[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

961.0M2](/packages/nzo-url-encryptor-bundle)[xxtea/xxtea

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

11341.7k](/packages/xxtea-xxtea)[miladrahimi/phpcrypt

Encryption, decryption, and hashing tools for PHP projects

3171.5k2](/packages/miladrahimi-phpcrypt)[hemiframe/php-aes

PHP class for encrypt and decrypt data with AES algorithm

1030.3k](/packages/hemiframe-php-aes)

PHPackages © 2026

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