Skip to content
Back to skills

Crypto

ASecurity

Client-side cryptography with libsodium. Use when working on files in src/lib/crypto/.

  • 666 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added February 8, 2026
securitytesting

Works with

  • cli

Security analysis

A100/100

Scanned February 10, 2026

npx -y skills add majiayu000/claude-skill-registry --skill crypto --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Crypto?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Crypto
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-crypto/badge)](https://www.skillsdirectory.com/skills/majiayu000-crypto)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: crypto
description: Client-side cryptography with libsodium. Use when working on files in src/lib/crypto/.
---

# 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

1. **Never log keys or sensitive data** - not even in development
2. **Use libsodium** - don't implement crypto primitives
3. **Async everywhere** - all functions async (libsodium-wrappers)
4. **Constant-time comparisons** - `sodium.compare` for secrets
5. **Zeroize secrets** - `sodium.memzero` when done
6. **Type-safe keys** - use branded types (VaultKey, SigningKey)

## Common Pitfalls

- Don't use `crypto.randomBytes` → use `sodium.randombytes_buf`
- Don't concatenate key material → use proper KDFs
- Don't store keys in localStorage without encryption
- Don't forget `await sodium.ready` before operations

## Testing

Use property-based tests for roundtrip verification with fast-check.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.