https://github.com/shetabit/aes
Encrypt and Decrypt data with AES algorithm
https://github.com/shetabit/aes
aes algorithm decrypt decryption encrypt encryption php
Last synced: about 2 months ago
JSON representation
Encrypt and Decrypt data with AES algorithm
- Host: GitHub
- URL: https://github.com/shetabit/aes
- Owner: shetabit
- Created: 2019-02-14T07:32:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-25T10:27:28.000Z (over 6 years ago)
- Last Synced: 2025-03-24T09:21:22.697Z (2 months ago)
- Topics: aes, algorithm, decrypt, decryption, encrypt, encryption, php
- Language: PHP
- Homepage:
- Size: 5.86 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AES
[](https://codeclimate.com/github/shetabit/AES/maintainability)
[](https://scrutinizer-ci.com/g/shetabit/AES/?branch=master)
[](https://github.styleci.io/repos/116474325)Encrypt and Decrypt data with AES algorithm with PHP
## Feature
* Set manually iv suitable for static inialization vector (IV)
* Set randomly iv (Recomended)## Example (Static IV)
```PHP
require "AES.php";$aes = new AES(
'WR7rLKlVvJdEAIzHUMpt4dcEKsXPinIU2KiWzm++bhg=',
'AES-256-CBC',
'NJ0oI9P1fytagUfPny3qTA=='
);$plainText = "Please, encrypt me!";
$encrypted = $aes->encrypt($plainText);
echo "Encrypted : {$encrypted}
";$decrypted = $aes->decrypt($encrypted);
echo "Decrypted : {$decrypted}
";
```## Example (Dynamic IV)
```PHP
require "AES.php";$aes = new AES(
'WR7rLKlVvJdEAIzHUMpt4dcEKsXPinIU2KiWzm++bhg=',
'AES-256-CBC'
);$plainText = "Please, encrypt me!";
$encrypted = $aes->encrypt($plainText);
echo "Encrypted : {$encrypted}
";$decrypted = $aes->decrypt($encrypted, true);
echo "Decrypted : {$decrypted}
";
```