plectrum / encryption
Encryption service library
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/plectrum/encryption
Requires
- php: ^7.4|^8.0
This package is auto-updated.
Last update: 2025-12-17 17:29:48 UTC
README
Encryption Service is a PHP library that provides encryption and decryption functionalities using AES-256-CBC cipher. It allows you to securely encrypt sensitive data using a secret key and retrieve the original data through decryption.
Main features:
- Encryption of data using AES-256-CBC cipher
- Decryption of encrypted data
- Input validation to ensure required variables are provided
- Error handling for decryption failures and invalid data
Installation
Install the library using composer:
composer require plectrum/encryption
Usage
require __DIR__ . '/vendor/autoload.php'; use Plectrum\Encryption\EncryptionService; $encryption = new EncryptionService(); $data = array('id'=>1); $secretKey='Your Secret Key'; //for encryption $encryptedData = $encryption->encrypt($data,$secretKey); echo $encryptedData; //for decryption $decryptedData = $encryption->decrypt($encryptedData,$secretKey); print_r($decryptedData); Make sure to replace `data` and `secretKey` with the appropriate values for encryption and decryption.