darkdevlab / encryptor
Encryption component. Support AES, BF, CAMELLIA, CAST5, DES, DESX, GOST, RC2 and RC4 algorithms
1.0.0
2020-05-03 10:01 UTC
Requires
- php: >=7.3
- ext-json: *
- ext-openssl: *
- darkdevlab/enum: ^2.0.0
Requires (Dev)
- phpunit/phpunit: 9.*
This package is auto-updated.
Last update: 2024-09-13 00:47:09 UTC
README
INSTALLATION:
composer require darkdevlab/encryptor
Supported cipher algorithms:
use DarkDevLab\Encryptor\Cipher; var_dump( Cipher::getList() );
USAGE
use DarkDevLab\Encryptor\OpenSslEncryptor; use DarkDevLab\Encryptor\Cipher; $encryptor = new OpenSslEncryptor('secret_key', Cipher::get(Cipher::AES_256_CBC)); $encryptedString = $encryptor->encrypt('{"data":"to", "encryption":12345}'); $decryptedString = $encryptor->decrypt($encryptedString);