dolphiq/laravel-aescrypt
dolphiq/laravel-aescrypt brings AES Crypt compatible file encryption to Laravel. It offers straightforward facades and helpers to encrypt or decrypt files using AES-256, making secure, standards-compatible file storage easy to add to any Laravel application.
Architecture fit: Narrow but clear. The package targets Laravel Eloquent models backed by MySQL and delegates encryption/decryption to MySQL native AES_ENCRYPT/AES_DECRYPT. It fits a monolithic Laravel app with MySQL where the requirement is “encrypted at rest in the database” and the threat model accepts that the database engine and DBAs can process plaintext and keys during queries. It does not fit polyglot persistence, PostgreSQL-first estates, strict zero-trust/DB-compromise models, or teams expecting application-layer envelope encryption.
Integration feasibility: Feasible for a small Laravel team: Composer install, configuration of an encryption key, model trait/cast usage, and schema changes to binary/blob columns. The real effort is not package installation; it is data migration, key management, query compatibility, and validation that encrypted columns remain usable for existing search/sort/filter behavior.
Technical risk: High for a security-sensitive dependency with only 17 stars and limited community evidence. Key risks:
AES_ENCRYPT without an IV typically uses ECB mode; package behavior must be confirmed. ECB leaks patterns and is unsuitable for high-cardinality sensitive data.AES_ENCRYPT does not provide authenticated encryption/integrity protection; ciphertext tampering may not be detectable.Key questions:
where clauses?TPM recommendation: Conditional pilot only. Use for a contained legacy/compliance use case on MySQL where DB-level encryption is acceptable and the data classification is moderate. Do not adopt as the platform-wide encryption standard without a security review, key-management design, and an exit/fallback plan.
Stack fit: Best fit is a Laravel monolith on MySQL 5.7/8.x with a dedicated set of encrypted columns. Keep high-sensitivity fields on an application-layer encryption library with authenticated encryption and envelope key management. Avoid using this package for primary keys, foreign keys, join keys, or fields requiring sorting/range queries.
Migration path: Treat this as a data migration project, not a library install.
VARBINARY/BLOB columns alongside existing plaintext columns.Compatibility: Confirm MySQL vs MariaDB behavior, AES function signatures, binary charset handling, maximum column lengths, and Laravel version constraints. Encrypted payloads expand in size; current column lengths and API validation rules must be adjusted. Any reporting, export, search, or third-party integration reading the affected columns must be reworked or given a controlled decrypt path.
Sequencing:
Maintenance: Expect internal ownership. With 17 stars and a small release history, the package should be version-pinned, covered by internal tests, and monitored for Laravel/MySQL compatibility. For critical use, plan to fork or vendor the code.
Support: No vendor SLA. Support is community/GitHub only, so the adopting team must own security patches, upgrade validation, and incident response. A named internal owner and documented escalation path are required.
Scaling: Encryption/decryption happens in MySQL, adding CPU cost per row and per query. Encrypted columns are poor candidates for indexes, sorting, LIKE, range filters, and reporting. Large result sets and exports will incur decrypt overhead. Read replicas and backups still contain ciphertext, but key exposure and query logging remain operational concerns.
Failure modes: Wrong or missing key produces null/garbled values; key rotation can strand old data; charset/binary mismatches can corrupt payloads; truncated columns can silently fail; MySQL function differences or upgrades can break decryption; partial migrations can create mixed plaintext/ciphertext states; query logs may expose plaintext or keys; rollback may be impossible if plaintext columns are dropped early. Each needs a detection, runbook, and rollback path.
Ramp-up: Low developer ramp-up for basic Eloquent usage, but meaningful cross-team ramp-up for DBA migration, security review, key management, and incident response. Budget one to two weeks for a controlled pilot, plus DBA and security time. The package is easy to try and harder to operate safely.
How can I help you explore Laravel packages today?