raph6 / enkryptor
Encryption module based on openssl
Installs: 758
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/raph6/enkryptor
Requires
- php: >=7.2
 
Requires (Dev)
- phpunit/phpunit: ^8.5
 
README
composer package for encryption using openssl
Installation
composer require raph6/enkryptor
How to use
use raph6\Enkryptor\Enkryptor; # encryption $encrypted = Enkryptor::encrypt('string to encrypt', 'password'); var_dump($encrypted); # decryption $decrypted = Enkryptor::decrypt($encrypted, 'password'); var_dump($decrypted);
Changing cipher method
By default cipher is AES 256 CBC, you can change this by adding a 3rd parameters, for exemple :
$encrypted = Enkryptor::encrypt('test', 'password', 'des-ede3-cfb1'); var_dump($encrypted); $decrypted = Enkryptor::decrypt($encrypted, 'password', 'des-ede3-cfb1'); var_dump($decrypted);
You can get available cipher methods by using
var_dump(Enkryptor::cipherList());