A lightweight AES library.

Installs: 286

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 0

Open Issues: 1

pkg:composer/benoitsan/aes

dev-master 2016-12-19 19:44 UTC

This package is not auto-updated.

Last update: 2026-02-14 18:56:57 UTC


README

BBAES-PHP is a lightweight AES Encryption Class with PHP 5.6+.

BBAES-PHP uses the AES128 algorithm in CBC mode with PKCS#7 padding.

Requirements

  • PHP 5.6+
  • PHPUnit to execute the tests (Optional).

Installation

Install first composer. Create the following composer.json file and run the composer install command to install it.

{
    "require": {
        "benoitsan/aes": "*"
    }
}
<?php
require 'vendor/autoload.php';

use \AES\AES;

$key = AES::saltPassword('password', AES::salt());
$encrypted = AES::encrypt('message', $key);
printf('encrypted: ' . $encrypted . "<br/>");
$decrypted = AES::decrypt($encrypted, $key);
printf('decrypted: ' . $decrypted);

Documentation

The file AES.php is documented. Have also a look at the demo and unit tests to see how to use the class.

Creator

BenoƮt Bourdon (@benoitsan).

License

BBAES-PHP is available under the MIT license. See the LICENSE file for more info.