implementing-envelope-encryption-with-aws-kms
यह क्या करती है
यह टूल आपके महत्वपूर्ण डेटा को सुरक्षित रखने में मदद करता है। यह डेटा को एन्क्रिप्ट करने के लिए एक सीक्रेट की (secret key) का इस्तेमाल करता है और उस सीक्रेट की को सुरक्षित रखने के लिए एक मास्टर की (master key) का, जिससे बहुत सारी फ़ाइलों या बड़ी फ़ाइलों को क्लाउड में स्टोर करना ज़्यादा सुरक्षित हो जाता है।
कब इस्तेमाल करें
- ✓जब कई फ़ाइलों को क्लाउड में सुरक्षित रखने की योजना बना रहे हों।
- ✓जब किसी खास सिक्योरिटी नियमों का पालन करना हो।
- ✓जब सिस्टम की सुरक्षा बनाना या बेहतर करना हो।
Skill का लिंक
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-envelope-encryption-with-aws-kms/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मैं इस तकनीक का इस्तेमाल करके क्लाउड में अपने ज़रूरी दस्तावेज़ों को सुरक्षित कैसे रख सकता हूँ?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
पहले, आपके डेटा को लोकल तौर पर एन्क्रिप्ट करने के लिए एक अस्थायी की (temporary key) बनाई जाती है। फिर इस अस्थायी की को AWS के पास रखी मास्टर की से सुरक्षित किया जाता है। डेटा पढ़ने के लिए यही प्रक्रिया उल्टी तरफ़ से चलती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
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
- Call
kms:GenerateDataKeyto get plaintext DEK + encrypted DEK - Use plaintext DEK to encrypt data locally (AES-256-GCM)
- Store encrypted DEK alongside ciphertext
- Discard plaintext DEK from memory
- For decryption: call
kms:Decrypton 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
अक्सर पूछे जाने वाले सवाल
AWS से सीधे एन्क्रिप्ट करने और इस तकनीक में क्या फ़र्क है?
सीधे एन्क्रिप्शन छोटी फ़ाइलों तक सीमित रहता है और धीमा होता है। इस तकनीक में AWS को कम कॉल करनी पड़ती हैं, जिससे बड़ी फ़ाइलों को तेज़ी से और कम खर्च में एन्क्रिप्ट किया जा सकता है।
क्या इस तकनीक से बहुत बड़ी फ़ाइलों को भी एन्क्रिप्ट कर सकते हैं?
हाँ, यह तकनीक बड़ी मात्रा में डेटा के लिए सबसे अच्छी है, क्योंकि मुख्य एन्क्रिप्शन लोकल तौर पर होता है और इसमें AWS कॉल की साइज़ की सीमा लागू नहीं होती।
क्या मास्टर की को स्टोर करना सुरक्षित है?
हाँ, मास्टर की AWS एक सुरक्षित माहौल (HSM) में संभालता है, और आप एक्सेस पॉलिसी के ज़रिए तय करते हैं कि उसका इस्तेमाल कौन कर सकता है।
जानकारी
लेखक का मूल विवरण
Implements envelope encryption with AWS KMS, encrypting data locally with a data encryption key (DEK) and protecting that DEK with a KMS-managed key (KEK), covering the encrypt/decrypt flow, KMS key types, and security validation criteria. Use when designing key management for encrypting large or numerous data objects on AWS, or when reducing direct KMS API call volume.
लोकप्रियता
- GitHub स्टार
- 35k
- रैंकिंग में स्थान
- #8038
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 31/8/2026
कमेंट
- …
इस repository की और skills
abusing-dpapi-for-credential-access
35kआपके AI एजेंट को किसी खास काम के लिए तैयार instructions देता है, ताकि वह उसे बेहतर और तेज़ी से कर सके।
abusing-shadow-credentials-for-privesc
35kआपके AI एजेंट को साफ़ और अच्छी तरह से व्यवस्थित लिखना सिखाता है।
achieving-cmmc-level-2-compliance
35kयह आपके एजेंट को CMMC Level 2 compliance के लिए environment तैयार करने में मदद करता है। यह security requirements लागू करता है और ज़रूरी documentation संभालता है।
acquiring-disk-image-with-dd-and-dcfldd
35kआपके एजेंट को hard drives की exact copies बनाने में मदद करता है। जाँच के दौरान किसी भी जानकारी के खोने या बदलने से बचाने के लिए यह उपयोगी है।
मिलती-जुलती skills
openclaw-update
394kयह आपके एजेंट को चल रहे OpenClaw Gateway को अपडेट करने में मदद करती है, इंस्टॉल के तरीके के अनुसार सही विधि चुनकर और सेशन बनाए रखकर।
diagnose-gateway
394kयह आपके एजेंट को सेटिंग्स, चैनल और पोर्ट जांचकर पता लगाने देती है कि OpenClaw Gateway क्यों फ़ेल हो रहा है, बिना कुछ बदले।
crabbox-apps
394kयह आपके एजेंट को किसी अस्थायी क्लाउड मशीन पर ऐप खोलने और चलाने देती है, फिर उसका व्यू आपके चैट के साइड पैनल में दिखाती है।