nowo-tech/doctrine-encrypt-bundle
A Symfony bundle for transparent field-level encryption in Doctrine entities. Protect sensitive database columns with encrypted DBAL types, PHP attributes, and configurable key management—ideal for GDPR compliance and secure application data.
Verdict up front: this is a thin, credible wiring layer over well-known crypto libraries, not a novel security product. Adopt only as a commodity convenience for encrypting a small number of non-queryable columns on a Symfony + Doctrine stack — and only after a short spike and a maintainer conversation. Do not treat it as a platform capability.
Architecture fit
preFlush/onFlush, decrypt on postLoad). That fits Symfony/Doctrine applications where entities are the only write path, but it is structurally incompatible with native SQL, DB views, reporting extracts, BI tools and any ETL that writes directly to the table.Integration feasibility
composer require, one config block, annotate/attribute the target fields, set key material in the environment. Realistically a 1–2 day spike to running, 2–3 weeks to production-grade with migration, rotation rehearsal and tests.LIKE, ORDER BY, range filters, joins on the field, and GROUP BY all stop working). Every existing query touching the field must be found and redesigned or dropped.UPDATE/DELETE, iterate()/scalar hydration, entity getReference proxies, and fixture loaders can bypass or break the listener. Audit these before committing.Technical risk
MysqlAes should be treated as a convenience for legacy/DB-side parity only — key material lives with the database, default block mode choices are weak, and it weakens the "app holds the key" separation that makes the whole approach worth doing.Key questions to put to the maintainer (and to our own security reviewer)
bin/console bulk re-encrypt, or per-record lazy rewrap? Is it resumable and idempotent?JSON/ArrayType columns, entity inheritance, and second-level cache?Stack fit
Migration path
FieldEncryptor interface and adapt the bundle behind it, so the vendor choice is reversible. This is the single highest-value TPM decision here — it caps the blast radius if the project is abandoned.Compatibility
composer.json; the low dependents count means version-combination bugs will not have been found by anyone else.Sequencing (dependency order)
security sign-off on threat model → vendor spike + maintainer Q&A → internal FieldEncryptor abstraction → schema width migration → pilot entity in staging → backfill tooling + rotation rehearsal → production pilot → review gate → expand.
Maintenance
Support and ownership
Scaling
MysqlAes option, which pushes decrypt work into the database and should be avoided at volume.Failure modes to instrument
Ramp-up
WHERE/ORDER BY without a blind index.Recommendation: conditional adopt — pilot on one low-volume, non-queryable field behind an internal abstraction, with an explicit exit criterion (if the maintainer cannot answer the rotation and fail-closed questions satisfactorily within the spike, build the equivalent in-house; it is roughly a one-week job over libsodium) and with key custody, escrow and rotation rehearsal treated as gates, not follow-ups.
How can I help you explore Laravel packages today?