yab/crypto
yab/crypto is a Laravel/PHP package that provides cryptographic helpers for encrypting, decrypting, hashing, and verifying data. It offers a simple, configurable API that integrates with Laravel's service container, making secure crypto operations easier to use across applications.
Architecture fit
The package is a conventional Laravel wrapper: service provider, facade, publishable config, PSR-friendly core. It drops into the container cleanly and reads naturally to any Laravel developer. The problem is that it is architecturally redundant with the platform. Laravel already ships Illuminate\Encryption\Encrypter (AES-256-CBC + HMAC, AES-256-GCM), the Crypt facade, Hash (bcrypt/Argon2), signed URLs, and encrypted cookies; PHP ≥7.2 ships libsodium. A third-party crypto layer only earns a place in the architecture if it exposes something the framework does not — envelope encryption, key IDs with rotation, asymmetric primitives, or a KMS abstraction. This one is a thin ergonomic wrapper, not a component. The correct framing for the TPM is pattern source, not dependency.
Integration feasibility
Mechanically trivial: composer require, auto-discovery on Laravel 5.5+, manual registration on Lumen. The blocker is lifecycle, not effort. The repository is archived, with 10 stars, zero dependents, and no CVE channel. Installation is a one-way door into permanent self-maintenance. Composer resolution against Laravel 9+/PHP 8.x is unverified and likely to fail on illuminate/* constraints — treat that as a probable hard stop until a spike proves otherwise.
Technical risk — HIGH
Cryptography is the one dependency class where "it works" and "it is correct" are different questions, and the failure mode is silent. Zero adversarial review and zero production hardening is disqualifying for anything customer-facing or regulated. The specific items that must be verified before any use, each disqualifying if wrong: source of randomness (random_bytes/sodium vs. anything else), AEAD vs. CBC-with-HMAC construction, nonce/IV generation and uniqueness, key derivation approach, and any residual mcrypt fallback (removed in PHP 7.2).
Key questions
Encrypter + sodium?composer.json PHP and illuminate/* constraints?Stack fit
Idiomatic to the framework, hostile to the security posture. Use it as discovery material for a one-day spike, not as a runtime dependency. If a specific primitive it exposes is genuinely needed, reimplement that primitive on sodium_compat or openssl_* behind an interface we own.
Migration path
Encrypter for at-rest field encryption and libsodium for everything the framework does not cover. This should be the default and require no further analysis.Compatibility
Validate PHP and Illuminate constraints first — this is a potential hard stop, not a nice-to-have. Then verify ciphertext portability across OpenSSL versions; if cipher and mode are not pinned explicitly, legacy ciphertext may not survive an OS upgrade.
Sequencing
SecretBox/EncryptionService interface so the implementation is swappable.Wrap it, don't sprinkle it: a single application-owned boundary class binding the package (or our replacement) means swapping one file instead of grepping dozens of call sites when it dies.
Maintenance
Archiving transfers all maintenance to us: security patching, PHP/Laravel compatibility, and ciphertext compatibility. The hours are small; the risk is unbounded, because nobody is watching upstream. A crypto dependency without a named owner is an unowned liability — budget a standing owner or do not take it.
Support
No upstream support, negligible community. The internal escalation path is "whoever forked it." That must be an explicit, accepted trade-off rather than an accident discovered during an incident.
Scaling
Throughput is a non-issue — the primitives are native and the wrapper overhead is negligible. The real scaling problem is key management and rotation. Every ciphertext written today is a permanent obligation to hold that key. Without a key-ID scheme, operational cost compounds with data volume and retention. Model this before writing the first record.
Failure modes
.env.Ramp-up
The API is small; a developer is productive in a day. Assurance onboarding is the expensive part — nobody on the team can credibly sign off on a construction they did not write, and an archived repo offers no external signal to lean on. Keep the effort at the evaluation layer: spend a day on a spike, capture the primitives it uses, close it out. The low score is the correct read; the high opportunity score reflects a tidy small repo, not a capability we should adopt.
How can I help you explore Laravel packages today?