phpaes/phpaes

AES cipher - FIPS 192 compliant

3.1.0 2018-01-16 01:21 UTC

This package is not auto-updated.

Last update: 2024-04-17 00:55:38 UTC


README

Build Status

FIPS-192 compliant AES cipher.

Supported key lengths:

  • 128 bits
  • 192 bits
  • 256 bits

Support block modes:

  • ECB: Electronic Code Book
  • CBC: Cipher Block Chaining
  • CFB: Cipher Feedback
  • OFB: Output Feedback

Supported padding schemes:

  • null byte (0x00)

Installation

Install via composer:

composer require phpaes/phpaes

Basic Usage

use PhpAes\Aes;

$aes = new Aes('abcdefgh01234567', 'CBC', '1234567890abcdef');

$y = $aes->encrypt('hello world!');
$x = $aes->decrypt($y);

echo base64_encode($y);
echo $x;

Static Code Analysis

Running Tests

vendor/bin/phpunit

Code Style

This project adheres to PSR-2 formatting.

vendor/bin/phpcs --extensions=php --report=summary --standard=PSR2 ./src ./tests