d3d9ex / doctrine-aes-256-ctr-encrypted-type
Doctrine custom type for AES-256 CTR mode encryption
v1.0.0
2024-01-19 19:00 UTC
Requires
- php: >=8.2
- ext-openssl: *
- doctrine/dbal: ^3.7
This package is auto-updated.
Last update: 2024-12-19 21:19:38 UTC
README
A custom Doctrine Type for AES-256 encryption in CTR mode.
Installation
composer require d3d9ex/doctrine-aes-256-ctr-encrypted-type
Configuration
use D3d9ex\Aes256CtrEncryptedType\Aes256CtrEncrypted; use Doctrine\DBAL\Types\Type; /* ... */ Type::addType(Aes256CtrEncrypted::NAME, Aes256CtrEncrypted::class); Aes256CtrEncrypted::setSecretKey(getenv('AES_KEY'));
Usage
use D3d9ex\Aes256CtrEncryptedType\Aes256CtrEncrypted; use Doctrine\ORM\Mapping as ORM; /* ... */ #[ORM\Entity] #[ORM\Table(name: 'entities')] class Entity { #[ORM\Column(name: 'secret_value', type: Aes256CtrEncrypted::NAME)] private string $secretValue; /* ... */ }