google/cloud-kms
Official Google Cloud PHP client for Cloud Key Management Service (KMS). Create and manage key rings and cryptographic keys, encrypt and decrypt data, sign and verify payloads, and control access with IAM policies from PHP applications.
KeyProvider wrapper.APP_KEY to envelope encryption: a KMS-held key-encryption key (KEK) wraps per-record or per-tenant data keys (DEKs). This is the decision point for field-level encryption of PII, payment data, and health data.Adopt when:
Encrypter/KeyProvider interface for testability and future portability.Look elsewhere when:
Crypt facade and encrypted casts are sufficient when there is no external key-custody requirement.google-cloud-php monorepo, so stars understate real usage and Google maintains it, but there is effectively no community layer — no tutorials, no third-party battle-testing, no Stack Overflow corpus. Budget for owning the wrapper, integration tests, and upgrade verification yourself.For executives: "We can move sensitive customer data from a single application key to Google-managed, HSM-backed encryption keys without building or operating key infrastructure. It is pay-per-use, requires no new headcount, and produces the audit evidence our SOC 2 / PCI / HIPAA conversations ask for. It also unlocks enterprise deals that require customer-managed keys. The trade-off is real vendor concentration on GCP for a security-critical component, and the library itself is thin — we own a small internal wrapper, roughly a few days of engineering, not a platform build."
For engineering: "Official Google client, Apache-2.0, standard Application Default Credentials, generated from the same protobufs as every other GCP SDK. Integration is a Composer require plus a singleton binding; credentials come from Workload Identity in production, not key files. We will not call it directly from controllers — we put it behind a KeyProvider contract with two implementations: Cloud KMS in production, and a local libsodium driver for tests, since Cloud KMS has no emulator. Expect envelope encryption (KMS encrypts DEKs, DEKs encrypt rows), cached DEKs to keep per-10k-operation costs and latency down, and a rotation job. The main engineering risk is not the API — it is that the community surface is near zero, so upgrades and edge cases are ours to validate."
One-line ask: Approve a spike to wrap Cloud KMS behind an internal key-provider interface, with a go/no-go gated on compliance sign-off for GCP as the root of trust.
How can I help you explore Laravel packages today?