turbolabit / php-encryptor
A single, zero-config service with encrypt() and decrypt() methods to safely share or expose confidential data
Installs: 519
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.2
- ext-openssl: *
Requires (Dev)
- phpunit/phpunit: @stable
- symfony/framework-bundle: @stable
This package is auto-updated.
Last update: 2025-07-12 15:01:44 UTC
README
A single, zero-config service with encrypt() and decrypt() methods to safely share or expose confidential data
๐ฆ 1. Install it with composer
symfony composer require turbolabit/php-encryptor:dev-main
๐ 2. Symfony usage
<?php use TurboLabIt\Encryptor\Encryptor; class Property { protected string $bookingToken = '12345678'; public function __construct(protected Encryptor $encryptor) {} public function getBookingData() : string { $arrData = [ "name" => 'aabbcc', "bookingToken" => $this->bookingToken; ] return $this->encryptor->encrypt($arrData); } public function decodeBookingData(string $text) : array { return $this->encryptor->decrypt($text); } }
See: Usage
3. โ๏ธ Symfony custom configuration (optional)
# config/services.yaml TurboLabIt\Encryptor\Encryptor: arguments: $secretKey: '%env(APP_SECRET)%'
See: services.yaml
๐งช Test it
git clone git@github.com:TurboLabIt/php-encryptor.git
cd php-encryptor
bash script/symfony-bundle-tester.sh