PHPackages                             dittertp/gibberish-aes-php - 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. dittertp/gibberish-aes-php

ActiveLibrary[Security](/categories/security)

dittertp/gibberish-aes-php
==========================

AES encryption library

4.0.0(3y ago)565.8k↓32.1%31MITPHPPHP &gt;=7.4

Since Nov 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dittertp/gibberish-aes-php)[ Packagist](https://packagist.org/packages/dittertp/gibberish-aes-php)[ RSS](/packages/dittertp-gibberish-aes-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (8)Used By (1)

[![Tests](https://github.com/dittertp/gibberish-aes-php/actions/workflows/main.yml/badge.svg)](https://github.com/dittertp/gibberish-aes-php/actions/workflows/main.yml)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/38faf3a4f490ea5082162df213b85c21ac7d6e8efcf1f74de1465bf169cd6339/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64697474657274702f6769626265726973682d6165732d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dittertp/gibberish-aes-php/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/523f88065212a8786d930d9c0cd5b029e23225504469bb837db0bcdfe9869729/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64697474657274702f6769626265726973682d6165732d7068702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dittertp/gibberish-aes-php/?branch=master)

Gibberish AES, a PHP Implementation
===================================

[](#gibberish-aes-a-php-implementation)

See Gibberish AES javascript encryption library,

An important note: The complementary JavaScript project Gibberish AES has been deprecated, see [mdp/gibberish-aes#25](https://github.com/mdp/gibberish-aes/issues/25)
Consider finding alternative PHP and JavaScript solutions.

This class is based on initial code proposed by nbari at dalmp dot com

Live Demo
---------

[](#live-demo)

Requirements:
-------------

[](#requirements)

php &gt;= 7.1

openssl and mbstring module

Usage Example:
--------------

[](#usage-example)

```
echo '';

// This is a secret pass-phrase, keep it in a safe place and don't loose it.
$pass = 'my secret pass-phrase, it should be long';
echo '$pass = '.$pass;
echo '';
// The string to be encrypted.
$string = 'my secret message';
echo '$string = '.$string;
echo '';
echo '';

// The default key size is 256 bits.
$old_key_size = GibberishAES::size();

echo 'Encryption and decryption using a 256-bit key:';
echo '';
GibberishAES::size(256);
// This is the result after encryption of the given string.
$encrypted_string = GibberishAES::enc($string, $pass);
// This is the result after decryption of the previously encrypted string.
// $decrypted_string == $string (should be).
$decrypted_string = GibberishAES::dec($encrypted_string, $pass);
echo '$encrypted_string = '.$encrypted_string;
echo '';
echo '$decrypted_string = '.$decrypted_string;
echo '';
echo '';

echo 'Encryption and decryption using a 192-bit key:';
echo '';
GibberishAES::size(192);
$encrypted_string = GibberishAES::enc($string, $pass);
$decrypted_string = GibberishAES::dec($encrypted_string, $pass);
echo '$encrypted_string = '.$encrypted_string;
echo '';
echo '$decrypted_string = '.$decrypted_string;
echo '';
echo '';

echo 'Encryption and decryption using a 128-bit key:';
echo '';
GibberishAES::size(128);
$encrypted_string = GibberishAES::enc($string, $pass);
$decrypted_string = GibberishAES::dec($encrypted_string, $pass);
echo '$encrypted_string = '.$encrypted_string;
echo '';
echo '$decrypted_string = '.$decrypted_string;
echo '';
echo '';

// Restore the old key size.
GibberishAES::size($old_key_size);
```

Author: Ivan Tcholakov, 2012-2016.

Author: Philipp Dittert, 2019-2020.

License: The MIT License (MIT),

A fragment of code is under the New BSD License, George Argyros, 2012.

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

[](#installation)

you can use the library by adding the following snippet to your composer.json

```
{
    "require": {
        "dittertp/gibberish-aes-php" : "^2.0"
    },
}
```

running code style check
------------------------

[](#running-code-style-check)

```
composer update
vendor/bin/phpcs --standard=PSR12 src/
```

running unit-tests
------------------

[](#running-unit-tests)

```
composer update
vendor/bin/phpunit --bootstrap bootstrap.php --configuration phpunit.xml
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 54.3% 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 ~477 days

Recently: every ~325 days

Total

7

Last Release

1337d ago

Major Versions

1.3.2 → 2.0.02020-01-26

2.0.0 → 3.0.02022-06-18

3.0.0 → 4.0.02022-09-19

PHP version history (3 changes)2.0.0PHP &gt;=7.1

3.0.0PHP &gt;=8.0

4.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/6bc010e493539dc97d8136da964a9daf8d1723d6277af26bd2e051fd32c65151?d=identicon)[dittertp](/maintainers/dittertp)

---

Top Contributors

[![ivantcholakov](https://avatars.githubusercontent.com/u/1438104?v=4)](https://github.com/ivantcholakov "ivantcholakov (19 commits)")[![dittertp](https://avatars.githubusercontent.com/u/1708286?v=4)](https://github.com/dittertp "dittertp (15 commits)")[![dkemper1](https://avatars.githubusercontent.com/u/108737202?v=4)](https://github.com/dkemper1 "dkemper1 (1 commits)")

---

Tags

encryptionaes

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/dittertp-gibberish-aes-php/health.svg)

```
[![Health](https://phpackages.com/badges/dittertp-gibberish-aes-php/health.svg)](https://phpackages.com/packages/dittertp-gibberish-aes-php)
```

###  Alternatives

[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k434.8M1.3k](/packages/phpseclib-phpseclib)[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)[mmeyer2k/dcrypt

A petite library of encryption functionality for PHP

98727.2k1](/packages/mmeyer2k-dcrypt)[brainfoolong/js-aes-php

Slim native AES encryption/decryption on client side with Javascript and on server side with PHP

1311.8k](/packages/brainfoolong-js-aes-php)

PHPackages © 2026

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