philetaylor/ciphersweet-encrypt
A Laravel package for integrating CipherSweet field-level encryption, letting you store sensitive database columns as encrypted values while keeping them searchable through blind indexes. It provides Eloquent-friendly configuration and casts for encrypting and decrypting attributes transparently.
LIKE, ranges, ORDER BY, or fuzzy match on encrypted columns. This directly constrains product surface: admin search, sorting by encrypted fields, and reporting must be designed around plaintext-derived aggregates or secondary stores. That is a roadmap decision, not an engineering detail.Consider it (as an architectural reference, not a runtime dependency) when:
encrypt() columns.Look elsewhere — or rather, go directly to CipherSweet or a maintained alternative — when:
encrypted cast and only need confidentiality with no lookup requirement — that's cheaper and first-party.For executives: We have a recurring blocker where compliance or customer contracts require sensitive fields to be unreadable in the database — but Product also needs to look records up by email, member ID, or SSN. Historically we've picked one or the other. The underlying technology (CipherSweet) lets us do both: values are encrypted, and we keep a separate non-reversible index for exact-match lookups. That unblocks a class of features we've been deferring, and it's an established pattern rather than something we'd invent.
The honest caveat to leadership: the specific package under review is a thin, single-maintainer wrapper — one star, no dependents, last shipped in 2020. I'm not recommending we take a runtime dependency on it. I'm recommending we standardize on CipherSweet directly and budget roughly a sprint of engineering to build and own the ~200 lines of framework glue. That's the same work either way, except we own it and it stays patched. Estimated scope: one sprint for the integration, plus a follow-on migration effort per encrypted column (backfill + key management), and a standing constraint that encrypted fields are exact-match only — no fuzzy search, no sorting.
For engineering: treat this repo as prior art. Read it for the DBAL type pattern, then implement the equivalent on top of current CipherSweet with a KMS-backed key provider, key-version tagging, and a documented rotation runbook. Non-negotiable: the key management story lands before the first encrypted column ships.
How can I help you explore Laravel packages today?