Encryption

From clawic/skills · View interactive version

Encryption is an AI agent skill from the GitHub repository clawic/skills. Encrypt files, secure passwords, manage keys, and audit code for cryptographic best practices.

How to use this skill

Skill file

When to Use

Algorithm Selection

| Purpose | Use | Avoid |

|---------|-----|-------|

| Passwords | argon2id, bcrypt (cost≥12) | MD5, SHA1, plain SHA256 |

| Symmetric | AES-256-GCM, ChaCha20-Poly1305 | AES-ECB, DES, RC4 |

| Asymmetric | RSA-4096+OAEP, Ed25519, P-256 | RSA-1024, PKCS#1 v1.5 |

| Key derivation | PBKDF2 (≥600k), scrypt, argon2 | Single-pass hash |

| JWT signing | RS256, ES256 | HS256 with weak secret |

| TLS | 1.2+ only | TLS 1.0/1.1, SSLv3 |

Critical Rules

  1. Never reuse IVs/nonces — AES-GCM + repeated nonce = catastrophic
  2. Use authenticated encryption (AEAD) — Plain CBC enables padding oracles
  3. Hash passwords, don't encrypt — Hashing is one-way
  4. No hardcoded keys — Use env vars, KMS, or Vault
  5. No Math.random() for crypto — Use CSPRNG only
  6. Constant-time comparisons — Prevent timing attacks on secrets
  7. Separate keys by purpose — Encryption ≠ signing ≠ backup

File Encryption (CLI)

# age (modern, simple)
age -p -o file.age file.txt
age -d -o file.txt file.age

# GPG
gpg -c --cipher-algo AES256 file.txt

Platform-Specific

See patterns.md for code snippets:

See mobile.md for:

See infra.md for:

Audit Checklist

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.