wemxo/encryption-bundle
wemxo/encryption-bundle provides simple, secure application-level encryption for PHP projects, helping protect sensitive data at rest with configurable keys and a clean service-based API for encrypting and decrypting values.
Architecture fit. The release adds an opt-in deterministic encryption mode to what is evidently a Laravel encryption package (custom encrypter, Eloquent cast, or service-provider binding). Deterministic encryption produces a stable ciphertext for a given plaintext/key pair, so the same value can be looked up with a where clause — this aligns with Laravel's existing encrypted cast ergonomics but changes the security contract from randomized (IND-CPA) to equality-revealing. Architecturally it should be a per-attribute or per-connection option, not a global default; if the package implements it as a config flag that flips all encryption, that is a significant design concern.
Integration feasibility. Likely low effort: bind a cast or call a facade method, set a key, done. Feasibility hinges on whether the package exposes the new mode alongside the existing API without forcing a ciphertext-format change for current data. If existing ciphertexts must be rewritten or the envelope version changes, effort jumps from hours to a migration project.
Technical risk.
Key questions.
Crypt, the encrypted cast, and existing where/whereIn query patterns without raw SQL?Stack fit. Fits Laravel 10/11-era patterns: a cast (DeterministicEncrypted), a facade method, and config-driven key binding. It works with Eloquent where/whereIn/exists and unique indexes, but not LIKE, range, prefix, or ordering — those require a separate blind-index or hashed-lookup design. Any code path that compares encrypted values in PHP rather than SQL needs review.
Migration path. Adopt as additive, never in-place:
Compatibility. Verify Laravel/PHP constraints, DB column type (varbinary/text with binary collation for exact match), and that existing encrypted casts are untouched. Confirm the package does not change the default cipher for non-deterministic fields — a silent default change would be a breaking change for every consumer.
Sequencing. (1) Security review of the primitive and key handling; (2) upgrade in a non-production environment and confirm legacy ciphertexts still decrypt; (3) pilot migration on one field; (4) publish internal guidance on which fields are permitted; (5) broad rollout per field, gated by review, with metric coverage on decryption failures.
Maintenance. Feature surface is small, but crypto code carries outsized review burden. Budget for periodic re-review of the dependency, and treat upgrades that touch key handling or ciphertext format as high-risk changes. Pin the version and read the changelog for every release.
Support. Needs a runbook covering: which fields are deterministic (maintain an explicit registry), how to rotate keys per mode, how to diagnose "lookup returns nothing" (usually key mismatch, collation mismatch, or mixed-mode data), and how to re-encrypt. On-call must understand that deterministic columns cannot be rotated without a reindex/backfill, unlike randomized columns.
Scaling. CPU cost is negligible. The real scaling concern is data leakage at rest: any replica, backup, analytics export, or read-replica consumer of a deterministic column now holds a searchable, frequency-analyzable corpus. Index size grows with the longer ciphertext. Consider whether analytics needs a separate tokenized or hashed representation instead.
Failure modes.
Ramp-up. Low for Laravel developers — one cast or facade call. Moderate for reviewers: the team needs a short internal note on what deterministic encryption does and does not protect, plus a hard rule that it is only for equality-searchable, low-sensitivity fields with explicit sign-off. Plan a half-day of security/ops alignment and a documented field registry before first production use.
How can I help you explore Laravel packages today?