spatie/laravel-ciphersweet
Laravel wrapper for Paragonie CipherSweet that adds searchable field-level encryption to Eloquent models. Encrypt/decrypt sensitive attributes and generate blind indexes so you can query encrypted data securely without exposing readable values in your database.
Compliance & Security Roadmap:
Searchable Encryption Use Cases:
User::whereBlind('email', ...)).status=shipped").medical_history) with searchable blind indexes for authorized queries.Data Migration Strategy:
php artisan ciphersweet:encrypt to migrate existing data without downtime (supports restartable batches).CIPHERSWEET_KEY updates).Validation & UX:
EncryptedUniqueRule for encrypted fields (e.g., email validation during signup).Adopt if:
status=active" without decrypting all records).Look elsewhere if:
For Executives: "This package lets us encrypt sensitive customer data (e.g., emails, payment details) in our Laravel app while keeping search functionality intact—critical for GDPR compliance and reducing breach risks. It’s like putting a vault around our database fields, but with a key we control. The cost? Minimal dev time (uses open-source CipherSweet) and a small performance tradeoff (~10–20ms slower for searches). We can phase this into our roadmap for high-risk data tables first."
For Engineers: *"Spatie’s LaravelCipherSweet wraps CipherSweet, a PHP library for searchable field-level encryption. Here’s the pitch:
users.email) at rest while enabling queries like User::whereBlind('email', 'email_index', 'user@example.com').UsesCipherSweet trait to models, define encrypted fields in configureCipherSweet(), and run php artisan ciphersweet:encrypt to migrate data.generate-key + re-encryption.EncryptedUniqueRule for encrypted fields.text columns for encrypted data.users table (encrypt email, add blind index) and benchmark search performance."*For Security/Compliance Teams: *"This solution addresses:
How can I help you explore Laravel packages today?