implementing-envelope-encryption-with-aws-kms
Envelope encryption is a strategy where data is encrypted with a data encryption key (DEK), and the DEK itself is encrypted with a master key (KEK) managed by AWS KMS. This approach allows encrypting
Best use case
implementing-envelope-encryption-with-aws-kms is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Envelope encryption is a strategy where data is encrypted with a data encryption key (DEK), and the DEK itself is encrypted with a master key (KEK) managed by AWS KMS. This approach allows encrypting
Teams using implementing-envelope-encryption-with-aws-kms should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/implementing-envelope-encryption-with-aws-kms/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How implementing-envelope-encryption-with-aws-kms Compares
| Feature / Agent | implementing-envelope-encryption-with-aws-kms | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Envelope encryption is a strategy where data is encrypted with a data encryption key (DEK), and the DEK itself is encrypted with a master key (KEK) managed by AWS KMS. This approach allows encrypting
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
AI Agents for Startups
Explore AI agent skills for startup validation, product research, growth experiments, documentation, and fast execution with small teams.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
SKILL.md Source
# Implementing Envelope Encryption with AWS KMS ## Overview Envelope encryption is a strategy where data is encrypted with a data encryption key (DEK), and the DEK itself is encrypted with a master key (KEK) managed by AWS KMS. This approach allows encrypting large volumes of data locally while keeping the master key secure in a hardware security module (HSM) managed by AWS. This skill covers implementing envelope encryption using AWS KMS GenerateDataKey API. ## When to Use - When deploying or configuring implementing envelope encryption with aws kms capabilities in your environment - When establishing security controls aligned to compliance requirements - When building or improving security architecture for this domain - When conducting security assessments that require this implementation ## Prerequisites - Familiarity with cryptography concepts and tools - Access to a test or lab environment for safe execution - Python 3.8+ with required dependencies installed - Appropriate authorization for any testing activities ## Objectives - Understand the envelope encryption pattern and its advantages - Generate data encryption keys using AWS KMS GenerateDataKey - Encrypt/decrypt data locally using DEKs - Store encrypted DEK alongside ciphertext - Implement key caching to reduce KMS API calls - Handle key rotation with automatic re-encryption - Implement multi-region encryption for disaster recovery ## Key Concepts ### Envelope Encryption Flow 1. Call `kms:GenerateDataKey` to get plaintext DEK + encrypted DEK 2. Use plaintext DEK to encrypt data locally (AES-256-GCM) 3. Store encrypted DEK alongside ciphertext 4. Discard plaintext DEK from memory 5. For decryption: call `kms:Decrypt` on encrypted DEK, then decrypt data ### Advantages Over Direct KMS Encryption | Aspect | Direct KMS | Envelope Encryption | |--------|-----------|-------------------| | Max data size | 4 KB | Unlimited | | Latency | Network round-trip per operation | Local encryption | | Cost | $0.03/10,000 requests | Fewer KMS requests | | Offline | Not possible | Yes (with cached DEKs) | ### KMS Key Types - **AWS Managed**: AWS creates and manages (`aws/s3`, `aws/ebs`) - **Customer Managed**: You create and manage policies - **Custom Key Store**: Backed by CloudHSM cluster ## Security Considerations - Never store plaintext DEK; only keep encrypted DEK - Use key policies to restrict who can call GenerateDataKey and Decrypt - Enable AWS CloudTrail logging for all KMS API calls - Implement key rotation (automatic annual rotation for CMKs) - Use encryption context for authenticated encryption metadata - Handle KMS throttling with exponential backoff ## Validation Criteria - [ ] GenerateDataKey returns plaintext and encrypted DEK - [ ] Data encrypts correctly with plaintext DEK using AES-256-GCM - [ ] Encrypted DEK can be decrypted via KMS Decrypt API - [ ] Decrypted DEK recovers the original data - [ ] Plaintext DEK is wiped from memory after use - [ ] Encryption context is validated during decryption - [ ] Key rotation re-encrypts DEKs with new master key
Related Skills
reverse-engineering-ransomware-encryption-routine
Reverse engineer ransomware encryption routines to identify cryptographic algorithms, key generation flaws, and potential decryption opportunities using static and dynamic analysis.
implementing-zero-trust-with-hashicorp-boundary
Implement HashiCorp Boundary for identity-aware zero trust infrastructure access management with dynamic credential brokering, session recording, and Vault integration.
implementing-zero-trust-with-beyondcorp
Deploy Google BeyondCorp Enterprise zero trust access controls using Identity-Aware Proxy (IAP), context-aware access policies, device trust validation, and Access Context Manager to enforce identity and posture-based access to GCP resources and internal applications.
implementing-zero-trust-network-access
Implementing Zero Trust Network Access (ZTNA) in cloud environments by configuring identity-aware proxies, micro-segmentation, continuous verification with conditional access policies, and replacing traditional VPN-based access with BeyondCorp-style architectures across AWS, Azure, and GCP.
implementing-zero-trust-network-access-with-zscaler
Implement Zero Trust Network Access using Zscaler Private Access (ZPA) to replace traditional VPN with identity-based, context-aware access to private applications through the Zscaler Zero Trust Exchange.
implementing-zero-trust-in-cloud
This skill guides organizations through implementing zero trust architecture in cloud environments following NIST SP 800-207 and Google BeyondCorp principles. It covers identity-centric access controls, micro-segmentation, continuous verification, device trust assessment, and deploying Identity-Aware Proxy to eliminate implicit network trust in AWS, Azure, and GCP environments.
implementing-zero-trust-for-saas-applications
Implementing zero trust access controls for SaaS applications using CASB, SSPM, conditional access policies, OAuth app governance, and session controls to enforce identity verification, device compliance, and data protection for cloud-hosted services.
implementing-zero-trust-dns-with-nextdns
Implement NextDNS as a zero trust DNS filtering layer with encrypted resolution, threat intelligence blocking, privacy protection, and organizational policy enforcement across all endpoints.
implementing-zero-standing-privilege-with-cyberark
Deploy CyberArk Secure Cloud Access to eliminate standing privileges in hybrid and multi-cloud environments using just-in-time access with time, entitlement, and approval controls.
implementing-zero-knowledge-proof-for-authentication
Zero-Knowledge Proofs (ZKPs) allow a prover to demonstrate knowledge of a secret (such as a password or private key) without revealing the secret itself. This skill implements the Schnorr identificati
implementing-web-application-logging-with-modsecurity
Configure ModSecurity WAF with OWASP Core Rule Set (CRS) for web application logging, tune rules to reduce false positives, analyze audit logs for attack detection, and implement custom SecRules for application-specific threats. The analyst configures SecRuleEngine, SecAuditEngine, and CRS paranoia levels to balance security coverage with operational stability. Activates for requests involving WAF configuration, ModSecurity rule tuning, web application audit logging, or CRS deployment.
implementing-vulnerability-sla-breach-alerting
Build automated alerting for vulnerability remediation SLA breaches with severity-based timelines, escalation workflows, and compliance reporting dashboards.