PHPackages                             ageid/encryption-helper - 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. ageid/encryption-helper

ActiveProject[Security](/categories/security)

ageid/encryption-helper
=======================

AgeID symmetric encryption helper

2.1(7y ago)134.0k↓32.3%1proprietaryPHPPHP &gt;=5.6.0

Since May 17Pushed 7y agoCompare

[ Source](https://github.com/AgeID/php-encryption-lib)[ Packagist](https://packagist.org/packages/ageid/encryption-helper)[ RSS](/packages/ageid-encryption-helper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (1)

AgeID Encryption Helper
=======================

[](#ageid-encryption-helper)

AES256 encryption and decryption helper for AgeID using an embedded random salt key.

The implementation is based on Laravel Encrypter.

Requirements: PHP 7

For PHP 5.6 compatibility, please install the PHP 5.x polyfill for random\_bytes() :

```
composer require paragonie/random_compat

```

Change Log
----------

[](#change-log)

List of releases and changes, with the latest at the top:

- v2.1
    - fixed compatibility with php 5.6
    - removed utf8 conversion for salt that was causing entropy loss
- v2.0 **\[!\] Should be used for v2 endpoint and forward \[!\]**
    - The number of iterations in EncryptionHelper is set by setting the version number on Instantiation; if it not set it will choose the latest version
    - Only allow salt with at least 16 Bytes
    - reduced the number of iterations to be 1024 by default
- \[first-release\]

Usage
-----

[](#usage)

**Installation**

Use composer to install the package

```
composer require ageid/encryption-helper

```

or download the the package and include the *src/\** files in your project.

**Encryption**

By default, it uses a random salt key, but it can be specified in the constructor.

Example:

```
    use AgeId\EncryptionHelper;

    $password = "8d6ea4d3e6f8c4f8641516baa5e42b85";

    $text = "text clear";

    $encrypter = new EncryptionHelper($password);
    $encrypted = $encrypter->encrypt($text);

    echo $encrypted;

```

**Decryption**

Example:

```
    use AgeId\EncryptionHelper;

    $password = "8d6ea4d3e6f8c4f8641516baa5e42b85";

    $hash = "eyJzYWx0IjoiVWluUHJUOFwvZVQ5REZUZ1wvUHo4NyIsImVuY3J5cHRlZCI6IjJxbzgzcmRsMWNWQ0VJTHVjazBJSFE9PSIsIm1hYyI6IjJmYWM3NWY4ZTk4NmI1MGYwMzgwYTcxYTgwMTA3NmNiM2Y3Y2MwYzBkZDNkNWIwOGYxNTI2ZTkwYTRlMTdkZjgifQ==";

    $decryptor = new EncryptionHelper($password);
    $decrypted = $decryptor->decrypt($hash);

    echo $decrypted;

```

Tests
-----

[](#tests)

In order to run the tests, please run in the package folder:

```
composer install
phpunit

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

2568d ago

Major Versions

1.0 → 2.02019-04-05

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39263914?v=4)[ageid](/maintainers/ageid)[@AgeID](https://github.com/AgeID)

---

Top Contributors

[![ageid-dev](https://avatars.githubusercontent.com/u/39263871?v=4)](https://github.com/ageid-dev "ageid-dev (3 commits)")

---

Tags

encryptionaesencryptdecryptAgeID

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ageid-encryption-helper/health.svg)

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[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)[miladrahimi/phpcrypt

Encryption, decryption, and hashing tools for PHP projects

3171.5k2](/packages/miladrahimi-phpcrypt)[poly-crypto/poly-crypto

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

127.8k1](/packages/poly-crypto-poly-crypto)[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)
