/cryptography-and-encryption:crypto-symmetric-aead-public-key-and-signaturesfrom cryptography-and-encryption
Guides selection of symmetric encryption modes, AEAD, public key cryptography (RSA, elliptic curves), key exchange with forward secrecy, and digital signatures with verification pitfalls.
Ships in cryptography-and-encryption. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Part 2 of 6 of the Cryptography and Encryption reference (plugin
cryptography-and-encryption), covering §6–§10. Sibling skills:crypto-what-it-solves-threat-models-randomness-hashes-and-macs(§0–§5),crypto-passwords-tls-pki-messaging-and-disk-encryption(§11–§16),crypto-implementation-failures-key-management-and-agility(§17–§19),crypto-advanced-constructions-blockchain-and-policy(§20–§22),crypto-reference(§23–§28). Section numbers are shared across the set; a reference written as §N →skillpoints into that sibling skill.Currency: The primitives are stable. Two migrations are actively underway. See §23 →
crypto-referencefor post-quantum cryptography, and TLS certificate lifetimes.
⚠️ Cryptography is the part of security that mostly WORKS. The primitives are rarely broken; the systems built from them fail constantly (§17 →
crypto-implementation-failures-key-management-and-agility). ⚠️ Almost every real-world break is a key management failure, an implementation bug, a protocol composition error, or a human process — not a cryptanalytic result.⚠️ THE RULE THAT MATTERS MOST: don't build it yourself. ⚠️ Use a vetted, well-maintained library at the highest level of abstraction that solves your problem. This document is for UNDERSTANDING what those libraries do and evaluating designs — not a recipe for implementing primitives.
Complements an electromagnetism reference (the physical layer), and security-focused material on threat modelling and application security.
⚠️ GOTCHA boxes mark the failure modes that have caused real breaches.
The three ideas that organize this document:
- ⚠️ ENCRYPTION WITHOUT AUTHENTICATION IS BROKEN (§7). Confidentiality alone is almost never what you want, and unauthenticated ciphertext is malleable. Use AEAD.
- ⚠️ KEY MANAGEMENT IS THE HARD PART (§18 →
crypto-implementation-failures-key-management-and-agility). The algorithm choice is usually easy and usually not where you lose. Where keys live, who can reach them, and how they rotate is where systems actually fail.- ⚠️ AGILITY IS A DESIGN REQUIREMENT (§19 →
crypto-implementation-failures-key-management-and-agility, §23 →crypto-reference). Every algorithm eventually weakens. Systems that hardcoded their primitives are the ones in pain right now.
⚠️ AES is the standard (128/192/256-bit keys), ⚠️ with hardware acceleration essentially universal. ⚠️ ChaCha20 is the good software-only alternative and is faster without AES instructions.
⚠️ MODES OF OPERATION — where block ciphers actually get used
⚠️ ECB ⚠️ NEVER. Identical plaintext blocks produce identical
ciphertext blocks — the famous encrypted-penguin image is
still visible. ⚠️ ECB leaks structure
⚠️ CBC needs a RANDOM, UNPREDICTABLE IV, and ⚠️ needs padding,
which creates PADDING ORACLE exposure (§17)
⚠️ CTR turns a block cipher into a stream cipher.
⚠️ NEVER REUSE A (key, nonce) PAIR — see §17
⚠️ GCM / ChaCha20-Poly1305 ⚠️ AEAD. Use these (§7)
⚠️ KEY SIZE ⚠️ AES-128 remains secure against classical attack;
AES-256 is the conservative choice and is already
quantum-adequate (§23.1)
⚠️ Stream ciphers: ⚠️ RC4 is broken and must not be used. ⚠️ The general stream cipher hazard is keystream reuse, which is catastrophic and easy to do accidentally.
⚠️ The single most important practical recommendation in this document: use AUTHENTICATED encryption with associated data, and don't compose encryption and authentication yourself.
⚠️ WHY ⚠️ unauthenticated ciphertext is MALLEABLE. An attacker can
flip bits in ciphertext and produce predictable changes in the
decrypted plaintext WITHOUT knowing the key. ⚠️ CTR-mode bit
flips map one-to-one onto plaintext bits
⚠️ THE ORDER MATTERS IF YOU DO IT MANUALLY
⚠️ ENCRYPT-THEN-MAC is the correct construction
⚠️ MAC-then-encrypt and encrypt-and-MAC have both produced
real vulnerabilities
⚠️ So don't do it manually — use AEAD
⚠️ USE ⚠️ AES-GCM · ChaCha20-Poly1305 · AES-GCM-SIV (⚠️ nonce-misuse
resistant — degrades gracefully rather than catastrophically) ·
XChaCha20-Poly1305 (⚠️ large nonce, so random nonces are safe)
⚠️ ASSOCIATED DATA authenticated but NOT encrypted — for headers
and routing information that must be visible but not forgeable
⚠️ AND ⚠️ DO NOT ACT ON DECRYPTED DATA BEFORE VERIFYING THE TAG.
Release of unverified plaintext is its own vulnerability class
⚠️ RSA based on factoring difficulty
⚠️ Use ≥2048-bit, preferably 3072+. ⚠️ RSA-1024 is not adequate
⚠️ PADDING IS MANDATORY AND SPECIFIC: OAEP for encryption,
PSS for signatures. ⚠️ "Textbook RSA" (no padding) is
completely insecure, and PKCS#1 v1.5 encryption padding has
a long history of oracle attacks (Bleichenbacher, and it
keeps coming back)
⚠️ ELLIPTIC CURVE ⚠️ much smaller keys for equivalent strength —
~256-bit EC ≈ ~3072-bit RSA
⚠️ Curve25519/X25519 and Ed25519 are the modern defaults —
designed to be MISUSE-RESISTANT, which matters more than
marginal performance
⚠️ NIST P-curves are widely deployed and required in some
compliance contexts; ⚠️ they are harder to implement safely
(point validation, invalid curve attacks)
⚠️ ASYMMETRIC CRYPTO IS SLOW ⚠️ so it is used to establish or wrap
a SYMMETRIC key, not to encrypt bulk data. This is hybrid
encryption and it is what essentially every real system does
⚠️ Diffie-Hellman lets two parties derive a shared secret over a public channel —
⚠️ and unauthenticated DH is vulnerable to machine-in-the-middle, so it must be combined
with authentication (§10, §13 → crypto-passwords-tls-pki-messaging-and-disk-encryption).
⚠️ GOTCHA — FORWARD SECRECY is the property to insist on, and it is defined by what happens AFTER a compromise. ⚠️ With ephemeral keys (ECDHE), compromising the long-term private key does NOT let an attacker decrypt previously recorded sessions. ⚠️ Without it — as in RSA key transport — one key compromise retroactively exposes everything ever recorded. ⚠️ This is exactly why "harvest now, decrypt later" is a real strategy and why §23.1 →
crypto-reference's timeline matters: recorded traffic is a stored liability.
⚠️ Post-compromise security / self-healing is the complementary property — ⚠️ the
ability to RECOVER security after a compromise, which ratcheting protocols provide (§14 → crypto-passwords-tls-pki-messaging-and-disk-encryption).
⚠️ Sign with the PRIVATE key, verify with the PUBLIC key — ⚠️ the inverse of encryption, and the confusion is common.
⚠️ ALGORITHMS ⚠️ Ed25519 (fast, deterministic, misuse-resistant —
the modern default) · ECDSA (widely deployed) · RSA-PSS
⚠️ ECDSA'S NONCE HAZARD ⚠️ ECDSA requires a per-signature random
value k. ⚠️ REUSING k ACROSS TWO SIGNATURES REVEALS THE PRIVATE
KEY through simple algebra. ⚠️ This has broken real systems,
including a well-known games console. ⚠️ Even BIASED k leaks
the key over many signatures
⚠️ Deterministic nonce generation (RFC 6979) or Ed25519 removes
this entire class of failure
⚠️ SIGN THE RIGHT THING ⚠️ sign a hash of a canonical encoding;
⚠️ ambiguity in what was signed is a real attack surface
⚠️ DOMAIN SEPARATION ⚠️ include context so a signature valid in one
protocol cannot be replayed as valid in another
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
6 skills in this plugin
/crypto-advanced-constructions-blockchain-and-policyUse for the frontier and the context around it: advanced constructions including zero-knowledge proofs, multiparty computation, homomorphic encryption and threshold schemes with honest notes on their maturity, the cryptography specific to blockchains, and the law and policy layer of export control, lawful access debates and compliance obligations./crypto-implementation-failures-key-management-and-agilityUse when reviewing or hardening a real system, where most breaks actually happen: implementation failure modes including timing and side channels, nonce reuse, padding oracles and misuse of primitives, key management covering generation, storage, rotation, escrow and HSMs, and crypto agility — designing so an algorithm can be replaced without redesigning the system./crypto-passwords-tls-pki-messaging-and-disk-encryptionUse for applied protocols: password storage and KDFs including Argon2, scrypt and bcrypt and the parameter choices that matter, TLS and its handshake and configuration, PKI, certificates and chain validation, end-to-end encrypted messaging with ratchets and metadata limits, disk and file encryption and what it protects against, and the other protocols worth knowing./crypto-referenceUse when correcting a cryptography misconception, looking up a key size, security level, hash output or KDF parameter, finding the books and references, or needing a quick-reference picker — plus the current state of the post-quantum migration and TLS certificate lifetimes. Companion to the other cryptography skills./crypto-what-it-solves-threat-models-randomness-hashes-and-macsUse before choosing any primitive: what cryptography does and does not solve and the problems people wrongly expect it to fix, threat models and what you are actually defending against, randomness and why CSPRNG choice and seeding is a common silent failure, hash functions and their security properties, and MACs and authentication. Includes the router for the whole cryptography reference.npx claudepluginhub the-vibey-project/vibey --plugin cryptography-and-encryption