PHPackages                             temant/encryption-manager - 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. temant/encryption-manager

ActiveLibrary[Security](/categories/security)

temant/encryption-manager
=========================

A comprehensive PHP library for encryption and decryption (AES-GCM) with file handling capabilities.

1.0.3(1y ago)05MITPHPPHP &gt;=8.3CI failing

Since Sep 12Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/EmadAlmahdi/Temant-EncryptionManager)[ Packagist](https://packagist.org/packages/temant/encryption-manager)[ RSS](/packages/temant-encryption-manager/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (2)Versions (5)Used By (0)

Temant Encryption Manager
=========================

[](#temant-encryption-manager)

[![Build Status](https://github.com/EmadAlmahdi/Temant-EncryptionManager/actions/workflows/ci.yml/badge.svg)](https://github.com/EmadAlmahdi/Temant-EncryptionManager/actions/workflows/ci.yml/badge.svg)[![Coverage Status](https://camo.githubusercontent.com/2c3ef074dad8f6df441877c18f95da66268a2250b56607c1bf0eed6aeb7a650b/68747470733a2f2f636f6465636f762e696f2f67682f456d6164416c6d616864692f54656d616e742d456e6372797074696f6e4d616e616765722f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://camo.githubusercontent.com/2c3ef074dad8f6df441877c18f95da66268a2250b56607c1bf0eed6aeb7a650b/68747470733a2f2f636f6465636f762e696f2f67682f456d6164416c6d616864692f54656d616e742d456e6372797074696f6e4d616e616765722f6272616e63682f6d61696e2f67726170682f62616467652e737667)[![License](https://camo.githubusercontent.com/de86b1e96d53820b74bb353226e72936e436366f14523e7a9498d7d24ed8ad65/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f456d6164416c6d616864692f54656d616e742d456e6372797074696f6e4d616e61676572)](https://camo.githubusercontent.com/de86b1e96d53820b74bb353226e72936e436366f14523e7a9498d7d24ed8ad65/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f456d6164416c6d616864692f54656d616e742d456e6372797074696f6e4d616e61676572)[![PHPStan](https://camo.githubusercontent.com/14995ff65edea59395c224e37e4fc66f91c1e601c1a58311e3c6f38c4fe37feb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c2532306d61782d627269676874677265656e)](https://camo.githubusercontent.com/14995ff65edea59395c224e37e4fc66f91c1e601c1a58311e3c6f38c4fe37feb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c2532306d61782d627269676874677265656e)

Temant Encryption Manager is a simple and secure encryption library for PHP. It provides an easy-to-use API for encrypting and decrypting strings and files using AES-128-CBC and AES-256-CBC encryption algorithms.

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

[](#installation)

You can install the library using Composer:

```
composer require temant/encryption-manager
```

Usage
-----

[](#usage)

### Encryption

[](#encryption)

To encrypt a string:

```
use Temant\EncryptionManager\EncryptionManager;
use Temant\EncryptionManager\EncryptionTypeEnum;

// Initialize the Encryption class with a key
$encryption = new EncryptionManager('your-encryption-key', EncryptionTypeEnum::BYTES_256);

// Encrypt a string
$plainText = 'Hello, World!';
$encrypted = $encryption->encryptString($plainText);

// Decrypt the string
$decrypted = $encryption->decryptString($encrypted);

echo "Encrypted: $encrypted\n";
echo "Decrypted: $decrypted\n";
```

### Encryption with Password

[](#encryption-with-password)

To encrypt a string with a password:

```
$plainText = 'Sensitive Data';
$password = 'your-secure-password';

$encrypted = $encryption->encryptString($plainText, $password);
$decrypted = $encryption->decryptString($encrypted, $password);

echo "Encrypted: $encrypted\n";
echo "Decrypted: $decrypted\n";
```

### File Encryption

[](#file-encryption)

To encrypt and decrypt files:

```
// Encrypt a file
$inputFile = 'path/to/input/file.txt';
$encryptedFile = 'path/to/encrypted/file.txt';
$password = 'file-password';

$encryption->encryptFile($inputFile, $encryptedFile, $password);

// Decrypt the file
$decryptedFile = 'path/to/decrypted/file.txt';
$encryption->decryptFile($encryptedFile, $decryptedFile, $password);

$decryptedContent = file_get_contents($decryptedFile);
echo "Decrypted file content: $decryptedContent\n";
```

Running Tests
-------------

[](#running-tests)

To run the tests, use the following command:

```
vendor/bin/phpunit
```

License
-------

[](#license)

This project is licensed under the BSD 3-Clause License License.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance59

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Total

4

Last Release

473d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/77153715?v=4)[Temant](/maintainers/Slvstar)[@Slvstar](https://github.com/Slvstar)

---

Top Contributors

[![EmadAlmahdi](https://avatars.githubusercontent.com/u/135208774?v=4)](https://github.com/EmadAlmahdi "EmadAlmahdi (6 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/temant-encryption-manager/health.svg)

```
[![Health](https://phpackages.com/badges/temant-encryption-manager/health.svg)](https://phpackages.com/packages/temant-encryption-manager)
```

###  Alternatives

[mews/purifier

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

2.0k18.7M143](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24820.0k37](/packages/paragonie-ecc)

PHPackages © 2026

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