Problem
Encrypted string with aes_binary_cryptor never matches with the same string previously encrypted with the same encryptor.
Current configuration
gtt_crypt:
cryptors:
aes:
aes_binary_cryptor:
key_size: 256
key_path: "%kernel.project_dir%/config/aes/first.key"
binary_output: true
doctrine:
dbal:
encrypted_string: aes_binary_cryptor
How to simulate the problem
$string1 = $this->crypt->encrypt('abc');
$string2 = $this->crypt->encrypt('abc');
// $string1 never matches with $string2!
How I'm applying it in a repository method
$qb = $this->createQueryBuilder('q');
$qb->andWhere('q.name = :name');
$qb->setParameter('name', $name, TypeEnum::ENCRYPTED_STRING);
$query = $qb->getQuery();
return $query->execute();