PHPackages                             djm56/php-string-encryption - 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. djm56/php-string-encryption

ActiveLibrary

djm56/php-string-encryption
===========================

Encrypt and Decrypt a String

v1.0.1(3y ago)06Apache-2.0PHPPHP &gt;=7.3.0

Since Sep 20Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (3)Used By (0)

PHP String Encryption
=====================

[](#php-string-encryption)

Class to encrypt and decrypt a string using openssl and open64.

I have used this in the past to encrypt/decrypt data at rest inside cookies that get used server side, or to encrypt/decrypt data at rest inside database.

This repo is still in development

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

[](#installation)

This project is using composer.

```
$ composer require djm56/php-string-encrytion

```

Usage
-----

[](#usage)

Define constants the encrytion\_key please change to something unique, the encrytion\_type can stay the same.

```
define('ENCRYPTION_KEY', 'abcdefghij1234');
define('ENCRYPTION_TYPE', 'AES-128-CBC');
```

Choosing the correct Encrytption type or cipher use the available php function to list them from instruction on this page

How to encrypt and decrypt:

```
use StringEncryption\Encryption;

$encryptedtext = Encryption::encrypt('test string');
$decryptedtext = Encryption::decrypt('encrypted string');
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

Every ~191 days

Total

2

Last Release

1143d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/716125486fa58e73a792418d394a0e636bd40ba574e9b81ea15a8db751243efb?d=identicon)[djm56](/maintainers/djm56)

---

Top Contributors

[![djm56](https://avatars.githubusercontent.com/u/1856297?v=4)](https://github.com/djm56 "djm56 (7 commits)")

### Embed Badge

![Health badge](/badges/djm56-php-string-encryption/health.svg)

```
[![Health](https://phpackages.com/badges/djm56-php-string-encryption/health.svg)](https://phpackages.com/packages/djm56-php-string-encryption)
```

PHPackages © 2026

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