aeliot/doctrine-encrypted-query
AES_ENCRYPT, AES_DECRYPT, custom hash-based queries).WHERE encrypted_column LIKE '%value%'), reducing custom SQL injection risks.aeliot/doctrine-encrypted-bundle for full functionality (e.g., entity field encryption). Standalone may lack critical features like key management or schema migrations.doctrine/orm or illuminate/database (if using Doctrine as a secondary ORM).AES_ENCRYPT, PostgreSQL’s pgp_sym_encrypt). Compatibility must be validated per DB.doctrine-encrypted-bundle may introduce versioning conflicts or unmaintained dependencies (0 stars, recent but unproven release).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| DB-Specific Functions | High | Test against target DB (e.g., MySQL 8+, PostgreSQL 12+). Fallback to application-layer encryption if unsupported. |
| Performance Overhead | Medium | Benchmark encrypted queries vs. plaintext. Consider partial encryption (e.g., only sensitive fields). |
| Key Management | Critical | Bundle requires external key storage (e.g., AWS KMS, HashiCorp Vault). Document compliance with security policies. |
| Query Complexity | Medium | Encrypted predicates may limit JOIN/GROUP BY optimizations. Profile with real-world queries. |
| Bundle Dependency | High | Evaluate if doctrine-encrypted-bundle meets all needs (e.g., schema migrations, bulk operations). |
encrypt()) or supplement it? Define scope (e.g., "only for searchable PII").encrypt()) for all sensitive data.encrypt() is used).email, phone).doctrine-encrypted-bundle in a staging environment.User) with 1–2 encrypted fields.WHERE queries on encrypted fields.JOIN, ORDER BY).AES_ENCRYPT in queries).^2.13).AES_ENCRYPT/AES_DECRYPT (8.0+).pgp_sym_encrypt/pgp_sym_decrypt.doctrine/orm config).doctrine/orm and aeliot/doctrine-encrypted-bundle.use Aeliot\DoctrineEncryptedBundle\Annotation\Encrypted;
/** @Encrypted */
private $ssn;
$qb->andWhere('AES_DECRYPT(encrypted_column, :key) LIKE :pattern')
->setParameter('key', $encryptionKey)
->setParameter('pattern', '%search%');
config/services.php for dev, Vault for prod).AES_DECRYPT(encrypted_column, ...)).SHOW PROCESSLIST (MySQL) for long-running encrypted queries.pg_stat_activity (PostgreSQL) for decryption bottlenecks.JOIN operations on encrypted fields (may prevent query optimization).| Scenario | Impact | Recovery Plan |
|---|---|---|
| Key Loss | Data becomes unreadable. | Backup keys in a secure vault. Implement key escrow. |
| DB Encryption Function Fails | Queries break. | Fallback to application-layer encryption. |
| Schema Migration Fails | Partial encryption corruption. | Rollback and retry with transaction isolation. |
| Performance Degradation | Slow queries under load. | Optimize queries; consider partial encryption. |
How can I help you explore Laravel packages today?