marko/encryption
Encryption support for the Marko framework, providing a simple service-provider integration for encrypting and decrypting application data with configurable keys and ciphers, plus helpers for secure serialization of values across your app.
What this package actually is. marko/encryption is a read-only monorepo split containing encryption contracts (interfaces) for the Marko PHP framework. It ships no cipher implementations, no key management, and no runtime dependencies — the PR/issue redirect to marko-php/marko confirms it is generated from the framework core for dependency-resolution purposes. Zero stars, zero dependents, and an unpopulated release history mean there is effectively no external ecosystem signal to evaluate.
Architecture fit. As a contracts-only package it occupies the correct architectural position: it defines a port (encrypter/signature interfaces) that the framework's container binds to a concrete adapter. That is the shape you want in a domain like cryptography — the interface is stable, the algorithm is swappable, and consumers depend on an abstraction rather than an implementation. It will drop cleanly into any Composer/PSR-4 PHP 8.x application. The architectural merit is real; the packaging and governance around it are not yet demonstrable.
Integration feasibility. Installing it is a one-line Composer change and low risk by construction (interface files only). The genuine integration effort sits entirely outside this package: providing a concrete Encrypter, choosing the cipher suite, sourcing and rotating keys, and defining the envelope format. Estimating effort from this repo alone is not possible without reading the parent framework's binding, which is where the actual behavior lives.
Technical risk. Low code risk, high blast-radius risk. Cryptography failures are unrecoverable and compliance-visible (SOC 2, PCI DSS, GDPR obligations around data-at-rest). An unmaintained or single-maintainer contract package is not itself dangerous, but it implies the implementing package is equally unproven, and an abandoned abstraction tends to trap teams on a deprecated algorithm with no upgrade path. There is no visible security disclosure policy, no CVE history to inspect, and no dependents to infer production hardening from. There is also a low-severity namespace/typosquat consideration given the near-zero download volume.
Key questions to resolve before any commitment
hash_hmac signatures)? Is authenticated encryption mandatory in the contract?Illuminate\Contracts\Encryption\Encrypter that we could swap implementations without touching call sites?Stack fit. Appropriate only in one of two scenarios: (a) we are standardizing on Marko as our framework, in which case this is a transitive dependency we accept by default and simply pin; or (b) we deliberately want a thin, framework-agnostic encryption port and are willing to own the adapter. In a Laravel, Symfony, or bespoke codebase, the cost/benefit of pulling in an unrelated framework's contracts is poor — we would be importing a dependency with no community, no documentation beyond source, and no upgrade guarantees, to obtain an interface we could define in twenty lines.
Migration path. If already on Marko: no migration, but establish a pinning and review policy on day one. If not on Marko: the sane path is to write our own narrow port (EncrypterInterface with encrypt/decrypt/sign) and bind Laravel's Encrypter or libsodium behind it — functionally equivalent, materially better supported. Adopting marko/encryption as the contract while binding a vetted implementation is technically feasible and does reduce lock-in, but the abstraction is only worth it if we also maintain contract tests, which is where the real cost lands.
Compatibility. Verify the PHP version constraint and whether the parent framework commits to semver on these split packages. Because the repo is read-only and issues are centralized, we cannot see downstream breakage signals; every upgrade must be validated in our own test suite. Confirm the package does not silently depend on a marko/framework version range that drags in unwanted code.
Sequencing.
Encrypter or sodium_crypto_secretbox) behind the contract; timebox to days, not weeks.Maintenance. The package itself is near-zero maintenance — interface files, no runtime dependencies, no attack surface. The maintenance burden is ownership: someone must watch the parent monorepo for releases and security notes, because there is no dependents graph, no advisory feed, and no ecosystem tooling that will alert us. Budget a recurring line item for dependency review, not for code changes.
Support. Community-only, via the central Marko repository, with no SLA and no commercial backer evident. For a system that stores regulated data, that is a material gap: the moment a cryptographic weakness is found is the worst possible time to discover the upstream has no triage process. If this sits on any compliance-relevant data path, we should require an internal fallback implementation and a documented exit plan before adoption.
Scaling. Throughput is CPU-bound on the cipher, not on the contract layer, so this package is not a scaling bottleneck. The scaling questions that matter are key rotation at volume (re-encrypting a large data set on rotation), multi-region key distribution, and whether the contract permits decrypt-with-old-key during rotation. None of those are answered by this repository; they must be answered before the data volume makes them expensive.
Failure modes.
Ramp-up. Negligible for a PHP developer to consume the interface — hours. The non-trivial learning is organizational: establishing a cipher policy, a key custody model, rotation runbooks, and a review process for cryptographic dependencies. That work is required regardless of which package supplies the contract, and it dwarfs the technical onboarding.
Assessment. Do not adopt as a standalone dependency. Accept it only as a transitive consequence of an explicit decision to standardize on Marko, pinned and reviewed. The underlying design instinct — contracts separated from implementation — is sound and worth copying in-house; the package's ecosystem maturity does not currently justify a dependency.
How can I help you explore Laravel packages today?