Documents

Encryption

Encrypt files, secure passwords, manage keys, and audit code for cryptographic best practices.

What it does

When to Use Encrypting files, database fields, or app storage Password hashing (bcrypt, argon2) Key management, rotation, derivation TLS/certificate configuration Auditing code for crypto mistakes Mobile secure storage (Keychain, Keystore)

The skill document

When to Use

  • Encrypting files, database fields, or app storage
  • Password hashing (bcrypt, argon2)
  • Key management, rotation, derivation
  • TLS/certificate configuration
  • Auditing code for crypto mistakes
  • Mobile secure storage (Keychain, Keystore)

Algorithm Selection

PurposeUseAvoid
Passwordsargon2id, bcrypt (cost≥12)MD5, SHA1, plain SHA256
SymmetricAES-256-GCM, ChaCha20-Poly1305AES-ECB, DES, RC4
AsymmetricRSA-4096+OAEP, Ed25519, P-256RSA-1024, PKCS#1 v1.5
Key derivationPBKDF2 (≥600k), scrypt, argon2Single-pass hash
JWT signingRS256, ES256HS256 with weak secret
TLS1.2+ onlyTLS 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:

  • Password hashing (Node, Python, Go)
  • Envelope encryption with KMS
  • JWT with RS256 key rotation
  • Secure token generation

See mobile.md for:

  • iOS Keychain wrapper
  • Android EncryptedSharedPreferences
  • SQLCipher setup
  • Biometric auth integration
  • Certificate pinning

See infra.md for:

  • TLS certificate auto-renewal
  • HashiCorp Vault policies
  • mTLS between services
  • Backup encryption verification

Audit Checklist

  • No plaintext passwords in DB/logs/env
  • No secrets in git history
  • No hardcoded keys in source
  • No Math.random() for security
  • No deprecated algorithms (MD5, SHA1, DES)
  • No disabled cert validation
  • IVs/nonces never reused
  • PBKDF2 iterations ≥600k / bcrypt cost ≥12
  • TLS 1.2+ enforced, old protocols disabled
  • Key rotation procedure documented

Related skills

Handle Git changes, conflicts, history recovery, and collaboration with repository-aware safety checks.

527 installs31 stars

Reduce OpenClaw token waste with lazy context, model routing, heartbeat planning, and local budget checks.

459 installs30 stars

Turns development work into scoped changes, verified tests, reviewable PRs, and reversible releases.

179 installs11 stars

Query Google Ads accounts and performance data with GAQL through managed OAuth.

261 installs20 stars

Build, debug, and review Vue 3 code across reactivity, components, state, routing, forms, and performance.

121 installs8 stars

More from Iván

Browse all skills

Write, debug, and tune Java and JVM systems with JDK-aware code and diagnostic steps.

by Iván130 installs9 stars

Design and critique visual artifacts using measurable rules for hierarchy, spacing, type, color, and layout.

by Iván137 installs5 stars

Diagnose CSS mechanics and produce targeted fixes or complete stylesheets for the chosen stack.

by Iván97 installs5 stars

Architect, troubleshoot, secure, and cost-control AWS infrastructure with explicit cost and blast-radius guidance.

by Iván138 installs2 stars

Diagnose, validate, transform, and evolve JSON payloads across parsers, schemas, storage, and large files.

by Iván112 installs3 stars

Build and operate a testable learning plan with practice, spaced review, transfer checks, and durable local records.

by Iván93 installs3 stars