Skip to content
Back to skills

Cryptography

ASecurity

Implement or review encryption, AEAD, password hashing, signatures, key derivation, TLS trust, certificates, randomness, KMS/HSM and key management. For PQC migration use the PQC skill.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 5, 2026
ai-agentsrustgoapisecuritydocumentation

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 5, 2026

npx -y skills add gethacked-ai/agent-security-skills --skill cryptography --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cryptography?

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

Security grade badge for Cryptography
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gethacked-ai-cryptography/badge)](https://www.skillsdirectory.com/skills/gethacked-ai-cryptography)

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: cryptography
description: >-
  Implement or review encryption, AEAD, password hashing, signatures, key derivation, TLS trust, certificates, randomness, KMS/HSM and key management. For PQC migration use the PQC skill.
metadata:
  version: "4.0.1"
---

# Cryptography

## When to use

Use when the cryptographic property or key lifecycle itself is in question. For quantum-specific migration prefer post-quantum-cryptography if available; avoid loading both for a narrow issue.

Select the required security property and a maintained protocol/provider, not a fashionable primitive. Do not invent cryptographic protocols or replace sound cryptography without evidence. Use synthetic keys in local tests; never disclose real keys, secrets or plaintext. Live key changes require authorization.

For explanation, design or review-only requests, do not edit project files. Use authorized isolated tests only when appropriate; report what was actually observed.

## Workflow

1. Identify the operation, data/identity being protected, adversary, trust boundary, key owner, protocol/format, provider and exact runtime version. Inspect call sites and effective configuration; a dependency or algorithm name is not proof of use.
2. Determine which properties are needed independently: confidentiality, integrity, identity authentication, replay resistance, password verification, key establishment or signature trust.
   Inspect the existing supported protocol and policy before adding dependencies.
   Verify current standards, errata, exact-version API docs and relevant provider security advisories, including runtime/OS backports and end-of-support where applicable.
   Record date and gaps if unavailable.
   If no suitable supported construction exists, report the blocker.
3. Choose the smallest supported change; implement only if requested.
   Before selecting or changing an encryption, password storage, signing, KDF, envelope or TLS trust construction, read the matching row in [implementation.md](references/implementation.md) for property-specific checks.
   Preserve required interoperability and security floors; version formats only when justified, with policy independent of untrusted metadata.
4. Design key lifecycle together with the operation: generation, storage and access, purpose separation, nonce/usage constraints, rotation, revocation, recovery, retirement and historical data.
   Do not confuse changing a key identifier, rewrapping a data key and re-encrypting ciphertext.
   For a migration, test existing records and backups before retiring keys.
   Distinguish routine rotation from compromise; revoke and investigate suspected exposure using the incident process.
5. Verify the actual property: relevant known-answer/conformance vectors where available, round trip, wrong key or identity, malformed or tampered inputs, policy rejection, and interoperability.
   Use authenticated decryption APIs correctly; do not consume unverified plaintext.
   For streaming formats verify chunk ordering, completeness and authentication as defined by the protocol.
   Check tests across restart/concurrency if nonce or state management is involved.
   Review failure behavior, logs and changes to trust or fallback.
   Do not disable checks to fix compatibility.

## Baseline floors

- **Randomness:** use the platform or provider CSPRNG only (`crypto/rand`, `SecureRandom`, `CryptGenRandom`, `getrandom(2)`). Never use a `rand()`-class source, `Math.random()`, a timestamp, a process ID or an unseeded PRNG for keys, nonces, salts, IVs or challenges. Never accept a user-supplied seed without an approved KDF deriving key material from it.
- **TLS:** default to TLS 1.3; support TLS 1.2 only where compatibility requires it, with AEAD cipher suites. Disable TLS 1.0 and TLS 1.1 and every SSL version. Set the minimum version explicitly and verify the effective policy on each termination boundary.
- **Signatures:** prefer Ed25519, ECDSA P-256 and RSA-PSS. Treat RSASSA-PKCS1-v1_5 as legacy for new signing: NIST IR 8547 approves it for signature verification, not for signature generation. Keep it only where an existing trust path requires it, and confirm current algorithm status, exact provider support and peer requirements before selecting.

## Finish

Report operation, chosen profile/provider/version, key lifecycle impact, evidence, actual test results and unresolved assumptions. Distinguish capability, configuration and observed behavior. When policy requires FIPS validation, verify the exact module, operational environment and approved service; standard algorithm support is insufficient. Use post-quantum-cryptography if available for quantum exposure and migration; do not automatically change all symmetric encryption or password hashing.

Sources: [NIST key management](https://csrc.nist.gov/projects/key-management), [OWASP Cryptographic Storage](https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html), [OWASP Transport Layer Security](https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Security_Cheat_Sheet.html), [NIST IR 8547](https://csrc.nist.gov/pubs/ir/8547/final), and the normative protocol and provider documentation.

## Example

Example: a valid AEAD round trip with a reused nonce is not enough. Establish the mode-specific nonce requirements, state persistence and key limits; verify tampered records are rejected before use.

Files in this skill

  • SKILL.md5.3 KB
  • references/implementation.md4 KB

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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