sidus/encryption-bundle
Sidus Encryption Bundle is a Symfony/Doctrine integration for transparent field-level encryption, automatically encrypting and decrypting sensitive entity fields so data is protected at rest while application code keeps using normal entity properties.
Verdict up front: Do not adopt sidus/encryption-bundle as a dependency. Leverage it as a design reference and a decision-forcing artifact for our encryption-at-rest roadmap. The bundle's contribution is the Doctrine integration layer, not the cryptography — and we do not run Doctrine.
Architecture fit
postLoad/prePersist/preUpdate subscribers) plus an EncryptionKey entity that stores key material alongside ciphertext. There is no Eloquent analogue: Laravel has no hydration-stage interceptor, and casts/observers/mutators cover different lifecycle points and miss DB::table(), chunked iteration, and raw query results uniformly.laravel-doctrine/orm) for a single feature — a dual-ORM persistence layer and a large architectural imposition for a narrow control.Integration feasibility
sodium_crypto_secretbox (or AES-256-GCM) payload encryption, envelope encryption with per-record data keys wrapped by a KMS master key, exposed as a custom cast; a Flysystem decorator for file encryption; a deterministic HMAC blind-index column where searchability is required.Technical risk
toArray(), JSON responses, logs, queue payloads, and caches. Non-deterministic ciphertext breaks equality queries, unique constraints, sorting, LIKE, and reporting.Key questions for stakeholders
Stack fit
Migration path
EncryptedCast on Laravel custom casts with libsodium secretbox; wrap data keys with the KMS master key and cache the unwrapped key per request.Compatibility
Sequencing
Maintenance
Support
Scaling
Failure modes
toArray(), logs, exception traces, cache, and queue serialization unless redaction is designed in.Ramp-up
How can I help you explore Laravel packages today?