https://github.com/matheusjohannaraujo/simple-aes-256
Simple AES 256 is a PHP class designed to simplify encryption and decryption using AES-256 in CBC or GCM modes.
https://github.com/matheusjohannaraujo/simple-aes-256
aes aes-256 aes-cbc aes-encryption aes-gcm aes256 php php-library php7 php8
Last synced: 5 months ago
JSON representation
Simple AES 256 is a PHP class designed to simplify encryption and decryption using AES-256 in CBC or GCM modes.
- Host: GitHub
- URL: https://github.com/matheusjohannaraujo/simple-aes-256
- Owner: matheusjohannaraujo
- License: mit
- Created: 2020-11-20T15:14:51.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-04-21T14:40:16.000Z (6 months ago)
- Last Synced: 2025-05-07T16:16:30.209Z (5 months ago)
- Topics: aes, aes-256, aes-cbc, aes-encryption, aes-gcm, aes256, php, php-library, php7, php8
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [Simple AES 256](https://github.com/matheusjohannaraujo/simple-aes-256)
**SimpleAES256** is a PHP class designed to simplify encryption and decryption using AES-256 in CBC or GCM modes.
## π¦ Installation
You can install the library via [Packagist/Composer](https://packagist.org/packages/mjohann/simple-aes-256):
```bash
composer require mjohann/simple-aes-256
```## βοΈ Requirements
- PHP 8.0 or higher
## π Features
- Supported AES 256 CBC and AES 256 GCM:
- `encrypt`
- `decrypt`
- `key`
- `tag`## π§ͺ Usage Example
### Example AES 256 CBC
```php
encrypt_cbc($text);
$decrypt = $aes->decrypt_cbc($encrypt);echo "Simple AES 256 CBC", PHP_EOL;
echo "Text: ", $text, PHP_EOL;
echo "Encrypt: ", $encrypt, PHP_EOL;
echo "Decrypt: ", $decrypt, PHP_EOL, PHP_EOL;
```### Example AES 256 GCM
```php
encrypt_gcm($text);
$tag = $aes->get_tag();
$decrypt = $aes->decrypt_gcm($encrypt, $tag);echo "Simple AES 256 GCM", PHP_EOL;
echo "Text: ", $text, PHP_EOL;
echo "Encrypt: ", $encrypt, PHP_EOL;
echo "Tag: ", $tag, PHP_EOL, PHP_EOL;
echo "Decrypt: ", $decrypt, PHP_EOL;
```For more examples, see the [`example/script.php`](example/script.php) file in the repository.
## π Project Structure
```
simple-aes-256/
βββ src/
β βββ SimpleAES256.php
β βββ Facades/
β βββ SimpleAES256.php
βββ example/
β βββ script.php
βββ composer.json
βββ .gitignore
βββ LICENSE
βββ README.md
```## π License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.
## π¨βπ» Author
Developed by [Matheus Johann AraΓΊjo](https://github.com/matheusjohannaraujo) β Pernambuco, Brazil.