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

Encryptor Laravel Package

nmure/encryptor

nmure/encryptor is a lightweight Laravel/PHP package for encrypting and decrypting sensitive data through a simple API, helping you secure strings and application values without adding complexity to your codebase.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

What it is. A single-purpose, thin wrapper over PHP's openssl_* functions for symmetric string encryption/decryption. MIT licensed, ~7 stars, zero dependents, last release 2017-12-02. That release date is the dominant fact in this assessment: it predates PHP 7.2 (mcrypt removal), PHP 8.0 (removal of openssl_free_key, stricter type handling), and the broad industry shift to AEAD-by-default.

Architecture fit. Poor as a strategic dependency, acceptable as a narrow utility. The package offers no key management, no envelope encryption, no versioned ciphertext format, and (almost certainly) no key rotation story. Any architecture that must satisfy SOC2/PCI/GDPR-adjacent controls needs ciphertext to be self-describing (algorithm + IV + tag + key id) so keys can be rotated without a flag day. A 2017-era API surface typically does not carry that metadata. Unless we are only encrypting transient, low-value, short-lived data inside one service, this is not an encryption architecture — it is a helper function.

Integration feasibility. Mechanically trivial. The API is small (likely encrypt/decrypt with a key and optional cipher), it is Composer-installable, and a competent PHP engineer can wrap it in an interface in under half a day. The risk is not effort; it is what sits underneath the trivial API.

Technical risk — the items I would block on until verified in source:

  • Authenticated encryption. If the default mode is CBC/CTR/ECB without an HMAC (encrypt-then-MAC), ciphertext is malleable and the library is a padding-oracle and bit-flipping liability. AES-256-GCM in openssl_encrypt was available in 2017, but wrappers of this vintage commonly default to AES-128-CBC.
  • IV/nonce handling. A fixed, key-derived, or zero IV is a catastrophic flaw (deterministic ciphertext, keystream reuse under CTR/GCM). Random IVs must be stored with the ciphertext — that requires a versioned envelope this API probably lacks.
  • Key derivation. If the "key" is hashed with md5/sha1 or used as a raw passphrase rather than a KDF (HKDF/sodium_crypto_pwhash), passphrase strength becomes the real key.
  • Encoding/base64 and OPENSSL_RAW_DATA flags — a classic source of silent truncation and null-byte handling bugs.
  • Unmaintained = unpatchable. No security contact, no CVE channel, no CI matrix. If a flaw is found, we fork and fix it ourselves; there is no upstream to lean on.
  • Abandonment signal in tooling. composer audit, Snyk, and Dependabot will flag an 8-year-stale package, creating friction with security review on every release.

Key questions to answer before committing (timebox: 1 day reading source + a 2-hour spike):

  1. Which cipher/mode does it default to, and is the default AEAD?
  2. How is the IV generated, and is it stored alongside the ciphertext or assumed?
  3. Is there integrity protection, and is comparison constant-time (hash_equals)?
  4. What PHP constraint is in composer.json, and does it actually pass on PHP 8.2/8.3?
  5. Is there any test suite, and does it cover tamper detection and round-trip with binary data?
  6. Is the maintainer reachable, and is there a documented security process?

Integration Approach

Stack fit. Fine for any PHP 7.4+/8.x service — it is framework-agnostic and does not touch Laravel internals, so it will not fight the container or config system. It slots in as a low-level string utility. It does not belong in a Laravel service provider as a first-class encryption driver, and it should never shadow Illuminate\Encryption\Encrypter (which, notably, already provides AES-256-CBC with HMAC authentication and key rotation via APP_PREVIOUS_KEYS).

Recommended decision. Do not adopt as net-new infrastructure. Ranked alternatives:

  1. Laravel's built-in Crypt facade — AEAD-ish (CBC + HMAC), maintained, supports key rotation. Zero new dependency.
  2. ext-sodium / sodium_crypto_secretbox — bundled since PHP 7.2, misuse-resistant, no package at all.
  3. defuse/php-encryption or paragonie/halite — if we need a standalone library with an audited envelope format and active maintenance.
  4. nmure/encryptor — only as a decryption adapter for existing ciphertext, or for genuinely low-stakes obfuscation of non-sensitive config values where a break is embarrassing, not material.

Migration path (if legacy ciphertext exists, which is the realistic reason this package surfaces):

  • Step 1 — Isolate. Define a domain interface (SecretBox::seal/open) and implement NmureEncryptorAdapter behind it. No application code imports the package directly. This makes replacement a one-file change.
  • Step 2 — Tag. Prepend a version byte to all new ciphertexts (v2:) so reader logic can branch by format without guessing.
  • Step 3 — Dual-read, single-write. Decrypt path tries v2 (new cipher), falls back to v1 (legacy). Write path emits v2 only.
  • Step 4 — Backfill. A queued, idempotent re-encryption job over the affected rows/records — batch, rate-limited, with a checkpointed cursor and a decrypt-verify-before-commit step. For large tables, run as a background job over days, not a single migration.
  • Step 5 — Retire. Once v1 read counts hit zero for a full retention window, remove the package and the dependency.

Sequencing. Interface + adapter (½ day) → source audit and go/no-go (1 day) → v2 writer + dual reader (1–2 days) → backfill job and dry run in staging (2–3 days) → production rollout behind a config flag → decommission. Roughly one engineer-week, dominated by the backfill, not the library swap.

Compatibility note. Pin an exact version in composer.json (there will be no ^ update risk because there are no updates) and add an explicit composer.json "abandoned"-style comment or a SECURITY.md note so a future maintainer does not read the dependency as a deliberate choice.

Operational Impact

Maintenance. Effectively zero upstream motion — which is not the same as zero cost. It converts a maintenance cost into an ownership cost: we are now the de facto maintainer of a vendored fork. Budget a fork in the org namespace if the audit surfaces any defect, because a PR to an 8-year-dormant repo is not a plan.

Support. No vendor, no SLA, no issue triage. Internal support burden is low in volume (the API is tiny) but high in expertise — the person who can safely debug it is a security-literate engineer, not a generalist. That is a scarce-resource dependency.

Scaling. Cryptographically, symmetric per-record encryption at these key sizes scales fine; throughput is dominated by OpenSSL, not by the wrapper. Operationally, the scaling problem is key rotation: without a ciphertext envelope carrying a key identifier, rotating keys means a full re-encrypt of all data or maintaining per-key code paths. That is the cost that grows non-linearly with data volume and retention.

Failure modes to monitor:

  • Silent decryption failure on malformed/truncated input (missing authentication means garbage may decrypt to garbage rather than erroring) — instrument decrypt failures as an alert, not a log line.
  • PHP runtime upgrade breaking the package (deprecated openssl_* signatures) — caught only by an integration test, so add one that round-trips and one that tampers with a byte and expects failure.
  • Key misconfiguration (wrong key in a new environment) discovered only at read time.
  • Padding-oracle exposure if ciphertext is ever returned to an untrusted client — audit any endpoint that echoes encrypted blobs.
  • Loss of the sole maintainer's repo (delete/archive) — vendor the source into our own repository rather than relying on Packagist availability.

Ramp-up. Very low for happy-path use (hours). Steep for safe use — an engineer must know enough crypto to recognize whether the defaults are sound, which is precisely the knowledge that would lead them to pick a different library. That asymmetry is the core argument against adoption: the package is easy to use and hard to use correctly, and it gives no signal about which one you are doing.

Bottom line. Score and staleness are consistent with the evidence: an unaudited, unmaintained, unvalidated single-author wrapper around primitives PHP already ships natively. Recommend no new adoption; permit it only as a temporary decryption adapter inside an isolated interface with a scheduled retirement, and treat any pre-existing production use as a finding to remediate this quarter.

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.
skyraptor/chatter
edlugz/sasapay
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