Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Encryption Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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.

  • Cryptographic: deterministic encryption leaks equality and frequency. Low-entropy fields (emails, phone numbers, status codes, SSNs) are vulnerable to dictionary/statistical attacks against a stolen ciphertext column — a database dump plus a known value distribution can recover plaintext. It is not a substitute for searchable-encryption schemes with proper leakage control.
  • Primitive choice is unknown. AES-SIV (RFC 5297) is the defensible construction; "AES-CBC with a fixed IV" or "HMAC-then-encrypt with a reused nonce" would be unacceptable. This must be verified before adoption.
  • Misuse risk: the feature is easy to apply too broadly. Without guardrails (naming, docs, code review checks), teams will flip sensitive columns to deterministic mode for convenience.
  • Data/format risk: ciphertext length changes (SIV adds ~16 bytes), column widths, binary collation requirements, and mixed old/new ciphertext in one column can cause silent lookup misses.

Key questions.

  1. Which construction backs deterministic mode (AES-SIV, AES-GCM-SIV, HMAC-based blind index, other)? Is it authenticated?
  2. Is the mode scoped per attribute/per model, or global?
  3. Are deterministic and randomized keys separated (distinct key material / KDF context)?
  4. Is there a versioned ciphertext envelope, and can old randomized data coexist in the same column?
  5. Does the package support key rotation, and what happens to deterministic indexes during rotation?
  6. What are the documented guidance and explicit "do not use for" list?
  7. Has the implementation had independent security review? What Laravel/PHP versions are supported?
  8. Does it integrate with Crypt, the encrypted cast, and existing where/whereIn query patterns without raw SQL?

Integration Approach

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:

  1. Pilot on one non-critical equality-lookup field (e.g., a normalized email column used only for exact-match login lookup).
  2. Add a ciphertext version/prefix byte so the reader can distinguish randomized from deterministic values.
  3. Introduce a dual-read path (try deterministic, fall back to legacy/randomized) and a backfill job that re-encrypts in batches with dual-write during the window.
  4. Only after backfill completes, enforce deterministic mode at the cast level and drop the fallback.
  5. Keep a documented rollback: reverting means re-encrypting back to randomized and rebuilding any dependent indexes.

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.

Operational Impact

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.

  • Silent lookup misses from key mismatch, wrong collation, or partially backfilled columns (worst case: users cannot log in, no error raised).
  • Accidental global enablement of deterministic mode, de-anonymizing sensitive columns.
  • Rotation performed without reindexing, producing two ciphertexts for one plaintext and breaking uniqueness constraints.
  • Ciphertext length overflow on columns sized for the previous format.
  • Downgrade or package removal leaving undecryptable rows.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package