Agent skill
crypto
Client-side cryptography with libsodium. Use when working on files in src/lib/crypto/.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/crypto
SKILL.md
Crypto Guidelines
All crypto happens client-side. Server NEVER sees plaintext.
Architecture
- Seed phrase (128-bit) → Ed25519 keypair (signing) → X25519 keypair (encryption)
- Vault key (random 256-bit) wrapped with user's X25519 public key
- Data encrypted with XChaCha20-Poly1305
Critical Rules
- Never log keys or sensitive data - not even in development
- Use libsodium - don't implement crypto primitives
- Async everywhere - all functions async (libsodium-wrappers)
- Constant-time comparisons -
sodium.comparefor secrets - Zeroize secrets -
sodium.memzerowhen done - Type-safe keys - use branded types (VaultKey, SigningKey)
Common Pitfalls
- Don't use
crypto.randomBytes→ usesodium.randombytes_buf - Don't concatenate key material → use proper KDFs
- Don't store keys in localStorage without encryption
- Don't forget
await sodium.readybefore operations
Testing
Use property-based tests for roundtrip verification with fast-check.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?