Customer Managed Encryption Keys: Enterprise Engineering
Customer managed encryption keys allow enterprise customers to provide and control the encryption keys used to protect their data inside your SaaS. The customer can rotate the key. The customer can revoke the key. Without the key, the data is unreadable. The capability is required for enterprise deals in regulated industries and increasingly expected at the top of B2B SaaS. The build is meaningful but contained.
Written by Yashveer Singh, founder of Yashveer Labs.
What you actually need to know
- CMEK is required for enterprise deals in regulated industries.
- The architecture uses the customer's key to wrap your data encryption key.
- Two to four months of engineering for a meaningful implementation.
- Multiple KMS providers are usually required.
- Revocation is the customer's nuclear option. Document the consequences.
| Implementation level | Engineering | Time to enterprise readiness |
|---|---|---|
| Standard encryption at rest | Days | Insufficient for many enterprise |
| Single tenant key | Weeks | Better but limited |
| CMEK with one KMS provider | 2 to 3 months | Adequate for most enterprise |
| CMEK with multiple KMS providers | 3 to 6 months | Enterprise grade |
The core argument
Customer managed encryption keys are one of those features that founders build last and discover they needed sooner. The first enterprise prospect asks. The team is not ready. The deal stalls or the team scrambles to ship CMEK under deadline pressure. The pattern is common enough that I now recommend planning for CMEK at the same time as planning for SOC 2.
The capability is not as exotic as it sounds. The customer provides a key. The application uses that key to encrypt the data encryption key. The DEK encrypts the customer's data. The customer's key never lives at rest in your system. The customer can rotate, the customer can revoke, and your access tracks the customer's control.
The engineering is real. Two to four months for a meaningful implementation. The work splits into key wrapping architecture, KMS integration, audit logging, rotation flow, and revocation handling. Each piece is contained but has to work together. The combination is enterprise grade encryption that survives security review.
The trade off is that the capability is a feature most customers will never use. Smaller customers do not need CMEK and would not value it. The investment is for the enterprise tier. The cost is justified by the deals that close with the feature and stall without it.
The architecture
The customer's key encryption key lives in the customer's KMS. The customer controls it. Your application requests an operation through the customer's KMS API. The KMS responds with a session token or wrapped data.
The data encryption key encrypts the customer's actual data. The DEK is stored in your system in wrapped form. The wrapping is done by the customer's KEK. Your system can decrypt the DEK only by calling the customer's KMS.
At use time, your application calls the customer's KMS to unwrap the DEK. The unwrapped DEK lives only in memory. The DEK decrypts the data the application needs. The DEK is discarded after use.
When the customer revokes their key, your subsequent KMS calls fail. The wrapped DEK cannot be unwrapped. The data is unreadable. The customer has cut your access.
How much does this cost
| Implementation | Engineering | Operating |
|---|---|---|
| Initial single provider build | 2 to 3 months | Negligible |
| Multi provider support | Additional month per provider | Negligible |
| KMS API calls | Pennies per operation | Scales with usage |
| Audit logging | Modest | Modest |
| Documentation and customer onboarding | A few weeks | Ongoing |
Features the CMEK implementation must have
- Key wrapping architecture with proper DEK handling.
- Integration with at least the customer's KMS provider.
- Audit logging of every key operation.
- Rotation flow that the customer can trigger.
- Revocation handling that fails gracefully.
- Recovery flow when the customer restores access.
- Documentation that the customer can implement.
- Onboarding support for customer KMS setup.
Expert opinion
CMEK is the kind of feature where the right time to build is before the customer asks. The teams that build it on a deadline ship something that meets the letter of the requirement but lacks the polish that enterprise security teams notice. The teams that build it deliberately ship a feature that earns trust in security reviews. The deals close faster. The customers are more confident.
>
Yashveer Singh, founder of Yashveer Labs
How this played out on a real project
A SaaS client was three months from a major enterprise contract. The customer's security team required CMEK as a condition of signature. The team had no CMEK implementation.
We compressed the typical four month build into eleven weeks. The architecture work happened in the first three weeks. The AWS KMS integration in the next three. The audit logging in the next two. The rotation and revocation flows in the final three. The customer onboarding documentation followed in parallel.
The implementation shipped on schedule. The customer's security team reviewed and approved. The contract signed two weeks after the technical approval. The CMEK capability has since been used by four more enterprise customers. The investment paid back on the first deal alone.
For more on the related work, see encryption at rest vs in transit what customers will ask and the customer security questionnaire a strategic asset.
Common mistakes teams make
- Treating CMEK as optional until a customer asks.
- Single KMS provider when customers use multiple clouds.
- No audit logging on key operations.
- Storing the unwrapped DEK at rest.
- No graceful handling of revocation.
- Documentation that the customer cannot implement.
- Treating CMEK as standard encryption with extra steps.
- Underestimating the engineering time.
A 90 day implementation plan
- Weeks one to three. Architecture. Pick the KEK wrapping pattern. Document.
- Weeks four to six. First KMS provider integration. AWS KMS for most teams.
- Weeks seven to eight. Audit logging. Every key operation.
- Weeks nine to ten. Rotation flow. Test thoroughly.
- Weeks eleven to twelve. Revocation handling. Test failure modes.
- Week thirteen. Customer onboarding documentation.
For more on the related work, read encryption at rest vs in transit what customers will ask and secrets management for SaaS Vault AWS Secrets Manager Doppler. On the broader enterprise side, how to sell to enterprise without a full compliance stack is the natural next read.
Frequently asked
Why you should skip the agency and hire me instead
Agencies markup engineering work by three to five times. Yashveer Singh, founder of Yashveer Labs. I do the work directly. No project manager, no account manager, no overhead. The engineer you talk to is the engineer who writes the code. That changes the math on price, speed, and quality at the same time. If that sounds like the shape of project you have, we should talk.
Posts that line up with this one.
- Security, Auth, and Compliance
Encryption at Rest vs in Transit: What Customers Will Ask
Encryption at rest and in transit are the two questions enterprise customers ask first. Both are easy to get right. The teams that have not thought about either stumble on the easiest part of a security review.
- Security, Auth, and Compliance
Single Sign On for Enterprise SaaS: SAML and OIDC Compared
SSO is a procurement requirement for enterprise deals. Here is what SAML and OIDC each mean for your engineering roadmap.
- Security, Auth, and Compliance
SOC 2 Type I vs Type II: A Founder's Guide to Both
SOC 2 Type I proves you have the controls. Type II proves they work over time. Here is what each means and when you need them.
- Security, Auth, and Compliance
The Data Processing Agreement: A Founder's Practical Read
What a DPA actually requires, why enterprise buyers demand it before signing, and how to get one done without a full legal team.