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

Laminas Crypt Laravel Package

laminas/laminas-crypt

Laminas Crypt offers cryptographic tools for PHP applications: symmetric encryption, block ciphers, secure password hashing, key derivation, and public-key/hybrid encryption helpers. It provides a consistent, framework-agnostic API within the Laminas ecosystem.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • laminas/laminas-crypt is a framework-agnostic component from the Laminas (ex-Zend Framework) ecosystem. It provides block ciphers (OpenSSL/Hash adapters), key derivation, symmetric/asymmetric helpers (RSA, Diffie-Hellman), and password hashing adapters (Bcrypt, Apache-style MD5).
  • Laravel already ships equivalent first-party primitives on the same underlying PHP extensions: Illuminate\Encryption\Encrypter (AES-256-CBC/GCM + HMAC, key from APP_KEY) and Illuminate\Hashing\HashManager (Bcrypt, Argon2id, needsRehash). Installing this package creates two parallel crypto stacks in one codebase with different key management, payload formats, and rotation semantics.
  • Net architectural fit is poor: the package adds no capability Laravel lacks, while introducing a second source of truth for encryption keys and cipher configuration.

Integration feasibility

  • Technically trivial: Composer install, no service provider needed, no config publishing. That low friction is the trap — it makes adoption cheap and decommissioning the expensive part.
  • Real interoperability is narrow:
    • Password hashes: Laminas Bcrypt emits standard $2y$ hashes, so Laravel's Hash::check() verifies them directly; Hash::needsRehash() + Hash::make() migrates users on next successful login at zero risk. This is the only clean seam.
    • Ciphertext: Laminas\Crypt\BlockCipher output is not compatible with Laravel's Encrypter (different envelope, IV handling, and MAC layout). Any existing Laminas-encrypted data requires a bespoke decrypt path.
  • Legacy interop is the only defensible reason to install this: reading data produced by an existing Laminas/ZF application you are migrating onto Laravel.

Technical risk

  • Archived repository is a hard blocker for production use. No CVE response, no security advisories, no patch releases. Composer will surface Package is abandoned warnings, and SCA/SCA-gate tooling will flag it. This is a direct control failure for PCI DSS, SOC 2 CC7/CC8, and most enterprise vendor reviews that require maintained cryptography.
  • Transitive risk: the Laminas component family has been steadily archived/sunset, so abandoned dependencies are likely to appear and will compound the exception-request burden.
  • Crypto-agility risk: an unmaintained cipher library cannot absorb algorithm deprecations, extension changes (OpenSSL 3 provider shifts), or PHP runtime upgrades. Your PHP upgrade path becomes coupled to an unmaintained package.
  • Talent/support risk: near-zero community footprint (36 stars) and no vendor behind it — no escalation path, no upstream fixes, no security contact.

Key questions

  1. Is there any existing ciphertext or key material in a Laminas/ZF system that must be read? If no, this package should not be introduced at all.
  2. Which specific classes are in scope — password hashing only, or block cipher/RSA/DH? Password-only interop has a trivial exit; cipher interop is a migration project.
  3. What is the audit/compliance posture, and does an archived crypto dependency require a formal, time-boxed exception?
  4. Who owns the re-encryption/rotation backlog item, and by when must the exception be closed?
  5. Does any current code path use Mcrypt-era or non-standard cipher modes that Laravel cannot express natively?

Integration Approach

Stack fit

  • Do not adopt as a forward-looking dependency. Map each needed capability to a Laravel native equivalent:
    • Password hashing → Hash (Bcrypt/Argon2id), with needsRehash for transparent upgrade.
    • Symmetric encryption at rest → Crypt / Encrypter, with per-model or per-tenant key derivation rather than a second library.
    • Signing/tokens → Illuminate\Encryption, hash_hmac, or a maintained library (paragonie/halite, defuse/php-encryption) if you need a specific primitive Laravel lacks.
    • Asymmetric/RSA → openssl_* directly or a maintained, scoped library.
  • The only acceptable fit is a sealed, read-only compatibility shim for legacy data, isolated behind an interface so it can be deleted on a known date.

Migration path

  1. Inventory (spike, ~1 week): enumerate every call site and every byte of data encrypted or hashed by the Laminas stack. You cannot scope this without knowing whether ciphertext exists.
  2. Password hashes (no data migration): verify via Laravel Hash::check, migrate opportunistically on login with needsRehash. Drop the dependency once the shim is unused. Low risk, no downtime.
  3. Ciphertext (if present): build a LegacyDecryptor implementing a project-owned interface. Dual-read: try Laravel Crypt first, fall back to legacy, then immediately re-encrypt with the Laravel key and persist. Never dual-write.
  4. Batch backfill: queued, idempotent job per record, with a completion metric (legacy_ciphertext_remaining). Gate removal of the shim on that metric hitting zero plus a full backup window.
  5. Decommission: remove the package, its abandoned transitive deps, and the interface. Add a CI check that fails on composer why laminas/laminas-crypt.

Compatibility

  • PHP version support for the archived release line should be confirmed against your target runtime (Laravel 11+ requires PHP 8.2/8.3). Do not assume the last release (2024-07-17) covers future PHP minors — it will not get a compatibility patch.
  • Block cipher and RSA output formats differ from Laravel's; assume zero ciphertext portability and budget an explicit re-encryption workstream.
  • Bcrypt hash strings are portable; cost/round parameters may differ and are handled by needsRehash.

Sequencing

Inventory → password-hash migration (parallel, low risk) → legacy ciphertext dual-read + backfill (the long pole) → shim removal → dependency purge. Do the password work first to shrink the surface cheaply; do not start ciphertext backfill until the inventory is complete and the re-encryption job is idempotent and rehearsed on a restored production snapshot.

Operational Impact

Maintenance

  • An archived dependency transfers 100% of maintenance to your team: any bug, PHP incompatibility, or algorithm deprecation is yours to fork and patch. That is an unbounded, unbudgeted standing commitment for a package you did not need.
  • The shim must be treated as owned code with an owner, a removal ticket, and an expiry date in the exception register — not as a dependency.

Support

  • No upstream maintainer, no security contact, no CVE stream. Vulnerability response degrades from "bump the version" to "emergency fork and patch under incident pressure."
  • Expect recurring friction in procurement/security review cycles; each renewal requires re-justifying an abandoned crypto library.

Scaling

  • Cipher operations are inexpensive and not the scaling constraint. The real scaling problem is operational: every new service, environment, and tenant that touches the shim multiplies the blast radius and the eventual migration surface.
  • Two key-management regimes (Laravel APP_KEY + whatever the Laminas path uses) means duplicated rotation runbooks and duplicated key-compromise blast radius.

Failure modes

  • Silent decrypt failures in mixed-format data (new records written by Crypt, old by Laminas) if dispatch logic is wrong — data loss risk on write paths.
  • Key divergence between environments; legacy keys not present in dev/staging → untested fallback path.
  • Lost key = lost data: no rotation tooling, and rotation requires re-encrypting under both schemes simultaneously.
  • Runtime upgrade breakage: PHP minor or OpenSSL 3 provider change breaks the archived package in production with no upstream fix.
  • Compliance finding at audit: abandoned cryptography in a cardholder/data path is a predictable, avoidable exception.

Ramp-up

  • Low individual ramp-up — the API is simple and the team will learn it in hours. The expensive ramp-up is the organizational one: exception documentation, security sign-off, ownership assignment, and the re-encryption runbook.
  • Recommended effort envelope: 1–2 days for the compatibility spike to answer "does ciphertext actually exist?"; if no, close the request at zero cost and use Laravel native primitives. If yes, budget a 4–8 week migration workstream with a named owner and a decommission date, and explicitly accept the package only as read-only transitional code.
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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager