richardstyles/eloquentencryption
Compliance & Security Roadmap:
Build vs. Buy:
openssl_encrypt) or Laravel’s native encrypt() (which lacks key rotation).Use Cases:
credit_card_number, ssn) without per-tenant key management.user_credentials) while allowing key rotation per environment.Feature Prioritization:
failed_login_attempts).encrypt()).pgcrypto instead).| Solution | Pros | Cons | Best For |
|---|---|---|---|
Laravel Native encrypt() |
Simple, built-in | No key rotation | Low-risk data |
| TDE (Transparent Data Encryption) | Database-level security | Entire DB encrypted | Full-database compliance |
| Vault (Hashicorp) | Key management, HSM support | Complex setup | Enterprise key rotation |
| Custom PHP OpenSSL | Full control | Maintenance burden | Unique crypto needs |
Problem: "We’re storing sensitive customer data (e.g., SSNs, payment details) in plaintext, exposing us to compliance risks (GDPR fines up to 4% of revenue) and breaches. Current encryption methods don’t support secure key rotation, leaving us vulnerable to insider threats or key leaks."
Solution: "EloquentEncryption adds field-level RSA-4096 encryption to Laravel models with zero application changes—just annotate sensitive attributes. It’s MIT-licensed, battle-tested (used in [X] industries), and future-proofs against quantum risks. Key rotation is built-in, so we can update keys without decrypting/re-encrypting all data. This meets HIPAA/GDPR requirements while reducing breach liability."
ROI:
Ask:
"Approve a 2-week spike to encrypt high-risk fields (e.g., credit_card, medical_history). Budget $0; ROI is compliance and risk mitigation."
Why This Package?
#[Encrypt]). No ORM changes.app:key rotation without decrypting data (unlike Laravel’s encrypt()).phpseclib).Implementation Plan:
composer.json + configure config/eloquent-encryption.php.User::credit_card).php artisan encrypt:rotate (key rotation).->makeHidden(['encrypted_field'])).Trade-offs:
Success Metrics:
Next Steps:
"Let’s prototype with the User model’s ssn field this sprint. I’ll share a PR template for review."
How can I help you explore Laravel packages today?