cryptolisted
Install: claude install-skill arbazkhan971/godmode
# Crypto — Cryptography Implementation
## Activate When
- User invokes `/godmode:crypto`
- User says "encryption", "hashing", "password storage", "bcrypt", "argon2"
- User says "key management", "digital signature", "JWT signing"
- User says "TLS setup", "HTTPS configuration", "certificate"
- When code handles sensitive data (PII, financial, health records)
## Workflow
### Step 1: Requirements Assessment
Classify data: at rest (passwords, PII, financial, API keys), in transit (TLS, mTLS, DB connections),
integrity (signatures, HMAC, checksums), compliance (PCI-DSS, HIPAA, GDPR, FIPS).
### Step 2: Algorithm Selection
**Password hashing:** Argon2id (m=65536, t=3, p=4) primary. bcrypt (cost 12+) fallback. NEVER MD5, SHA1, SHA256, PBKDF2 (<100K iter).
**Symmetric encryption:** AES-256-GCM (AEAD, general). ChaCha20-Poly1305 (software-fast). NEVER ECB, DES, 3DES, RC4, AES-CBC without HMAC.
**Asymmetric:** X25519 (key exchange). RSA-OAEP 2048+ (encryption). NEVER PKCS1v1.5 or RSA <2048.
**Signatures:** Ed25519 (primary). RS256/ES256 (JWT). NEVER RSA PKCS1v1.5 sigs, DSA.
**Hashing (non-password):** SHA-256 (general). BLAKE3 (modern). HMAC-SHA-256 (keyed). NEVER MD5, SHA-1.
**Key derivation:** Argon2id (from password). HKDF-SHA-256 (from shared secret).
**Random:** CSPRNG only (crypto.randomBytes, secrets, crypto/rand). NEVER Math.random().
### Step 3: Encryption at Rest
Use **envelope encryption**: unique DEK per record (AES-256-GCM) encrypted by KEK from KMS. Store encry