Implementing aes encryption for data at rest

From xalgord/xalgorix · View interactive version

Implementing aes encryption for data at rest is an AI agent skill from the GitHub repository xalgord/xalgorix. 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 m

How to use this skill

Skill file

Implementing 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

Common Misconfigurations & Verification

Prerequisites

Objectives

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:

Nonce/IV Management

Workflow

  1. Install the cryptography library: pip install cryptography
  2. Generate or derive an encryption key
  3. Create a random nonce for each encryption operation
  4. Encrypt data using AES-256-GCM with the key and nonce
  5. Store nonce + ciphertext + authentication tag together
  6. For decryption, extract nonce, verify tag, and decrypt

Encrypted File Format

[salt: 16 bytes][nonce: 12 bytes][ciphertext: variable][tag: 16 bytes]

Security Considerations

Validation Criteria

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.