Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meezaan/aescryptor
A PHP package for AES Encryption / Decryption
https://github.com/meezaan/aescryptor
aes-256 aes-encryption encryption openssl php pipelines
Last synced: 3 months ago
JSON representation
A PHP package for AES Encryption / Decryption
- Host: GitHub
- URL: https://github.com/meezaan/aescryptor
- Owner: meezaan
- Created: 2024-05-29T05:48:36.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-05-29T18:04:42.000Z (8 months ago)
- Last Synced: 2024-08-14T22:38:29.933Z (5 months ago)
- Topics: aes-256, aes-encryption, encryption, openssl, php, pipelines
- Language: PHP
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AES Cryptor
A basic PHP package for encrypting and decrypting strings using an AES 256-bit key.
This library requires the PHP OpenSSL extension.
This package is based on https://gist.github.com/turret-io/957e82d44fd6f4493533.
## Installation
The package can be installed via composer:
```
composer install neezaan\aescryptor
```## Usage
This package can generate a secure key and initialisation vector for you. You will need to store the key securely, but this package handles storing the IV itself with the encrypted string, so you don't have to store it elsewhere.
Arguably this is less secure, but it makes the implementation simpler.```
encrypt($secret);// Decrypt your string
$decrypted = $aes->decrypt($encrypted);// Note that $decrypted === $secret
```
## PurposeThis library is built primarily for interoperability between applications and pipelines.
### Interoperability via Bash
Results produced by this library are not interoperable with the `openssl` cli on Linux.
To get the same results with PHP, see https://stackoverflow.com/questions/71198954/openssl-aes-256-cbc-encryption-from-command-prompt-and-decryption-in-php-and-vi.
## Credits
* https://gist.github.com/turret-io/957e82d44fd6f4493533
## License
MIT