PHP code example of d3d9ex / doctrine-aes-256-ctr-encrypted-type
1. Go to this page and download the library: Download d3d9ex/doctrine-aes-256-ctr-encrypted-type library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
d3d9ex / doctrine-aes-256-ctr-encrypted-type example snippets
use D3d9ex\Aes256CtrEncryptedType\Aes256CtrEncrypted;
use Doctrine\DBAL\Types\Type;
/* ... */
Type::addType(Aes256CtrEncrypted::NAME, Aes256CtrEncrypted::class);
Aes256CtrEncrypted::setSecretKey(getenv('AES_KEY'));
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;
/* ... */
}