
AES Encryption for Data at Rest
FreeSecurely implement AES-256 encryption for sensitive data.
Free · Opens the source repo
What AES Encryption for Data at Rest does
This skill provides a comprehensive guide for implementing AES-256 encryption in GCM mode, specifically designed for securing files and data stores at rest. It is ideal for developers and security professionals looking to enhance data protection through established cryptographic practices. The skill covers essential aspects such as key derivation, nonce management, and authenticated encryption, ensuring that users can effectively safeguard sensitive information against unauthorized access.
Users will learn how to derive encryption keys securely using methods like PBKDF2 and Argon2, which are critical for maintaining the integrity of the encryption process. The skill emphasizes the importance of nonce management, instructing users on how to generate and store nonces securely, which is vital for preventing vulnerabilities associated with nonce reuse. Additionally, the skill details the proper encrypted file format and validation criteria to ensure that the implementation meets security standards.
This skill is particularly beneficial for those deploying encryption solutions in compliance with regulatory requirements or conducting security assessments. It provides a clear workflow for implementing AES encryption, making it a valuable resource for anyone involved in data security. By following the outlined procedures, users can confidently encrypt and decrypt sensitive files, ensuring that their data remains protected at all times.
When to use it
Use this skill when you need to deploy or configure AES encryption for sensitive data storage, particularly in compliance-driven environments.
When not to use it
This skill may not be suitable for those without a foundational understanding of cryptography or for environments where lightweight encryption is sufficient.
What you can build with it
Deploying Encryption for Compliance
Implement AES-256 encryption in environments that require compliance with data protection regulations, ensuring sensitive data is secured.
Conducting Security Assessments
Use this skill to review existing encryption implementations during security assessments, verifying adherence to best practices.
Building Secure Applications
Integrate AES encryption into applications that handle sensitive data, enhancing overall security architecture.
How to install AES Encryption for Data at Rest
View source1. Install with the skills CLI
npx skills add mukul975/anthropic-cybersecurity-skills/implementing-aes-encryption-for-data-at-rest --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by mukul975Implementing AES Encryption for Data at Rest
Overview
AES (Advanced Encryption Standard) is a symmetric block cipher standardized by NIST (FIPS 197) used to protect classified and sensitive data. This skill covers implementing AES-256 encryption in GCM mode for encrypting files and data stores at rest, including proper key derivation, IV/nonce management, and authenticated encryption.
When to Use
- When deploying or configuring implementing aes encryption for data at rest 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
- Implement AES-256-GCM encryption and decryption for files
- Derive encryption keys from passwords using PBKDF2 and Argon2
- Manage initialization vectors (IVs) and nonces securely
- Encrypt and decrypt entire directory trees
- Implement authenticated encryption to detect tampering
- Handle large files with streaming encryption
Key Concepts
AES Modes of Operation
| Mode | Authentication | Parallelizable | Use Case |
|---|---|---|---|
| GCM | Yes (AEAD) | Yes | Network data, file encryption |
| CBC | No | Decrypt only | Legacy systems, disk encryption |
| CTR | No | Yes | Streaming encryption |
| CCM | Yes (AEAD) | No | IoT, constrained environments |
Key Derivation
Never use raw passwords as encryption keys. Always derive keys using:
- PBKDF2: NIST-approved, widely supported (minimum 600,000 iterations as of 2024)
- Argon2id: Winner of Password Hashing Competition, memory-hard
- scrypt: Memory-hard, good alternative to Argon2
Nonce/IV Management
- GCM requires a 96-bit (12-byte) nonce that must NEVER be reused with the same key
- Generate nonces using
os.urandom()(CSPRNG) - Store nonce alongside ciphertext (it is not secret)
Workflow
- Install the
cryptographylibrary:pip install cryptography - Generate or derive an encryption key
- Create a random nonce for each encryption operation
- Encrypt data using AES-256-GCM with the key and nonce
- Store nonce + ciphertext + authentication tag together
- For decryption, extract nonce, verify tag, and decrypt
Encrypted File Format
[salt: 16 bytes][nonce: 12 bytes][ciphertext: variable][tag: 16 bytes]
Security Considerations
- Always use authenticated encryption (GCM, CCM) to prevent tampering
- Never reuse a nonce with the same key (catastrophic in GCM)
- Use at least 256-bit keys for long-term data protection
- Securely wipe keys from memory after use when possible
- Rotate encryption keys periodically per organizational policy
- For disk-level encryption, consider XTS mode (AES-XTS)
Validation Criteria
- AES-256-GCM encryption produces valid ciphertext
- Decryption recovers original plaintext exactly
- Authentication tag detects any ciphertext modification
- Key derivation uses sufficient iterations/parameters
- Nonces are never reused for the same key
- Large files (>1GB) can be processed via streaming
- Encrypted file format includes all necessary metadata
Frequently asked questions about AES Encryption for Data at Rest
Similar skills
GitHub Actions Hardening
Enhance the security of your GitHub Actions workflows.
Sensitive Logging Audit
Audit and fix sensitive data exposure in Python logging.
Android App Static Analysis
Automate security assessments of Android apps with MobSF.
Integrating DAST with OWASP ZAP
Seamlessly integrate dynamic security testing into CI/CD pipelines.
Implementing Runtime Security with Tetragon
Enhance Kubernetes security with eBPF-based observability.
Implementing Mobile Application Management
Secure enterprise data on mobile devices with app-level controls.
