crypto-protocol-diagram

Extracts protocol message flow from code or specs and generates annotated Mermaid sequence diagrams.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/marumo333/atrox --skill crypto-protocol-diagram-marumo333
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: crypto-protocol-diagram
Source: https://github.com/marumo333/atrox/tree/main/.claude/skills/trailofbits/plugins/trailmark/skills/crypto-protocol-diagram
Command: npx skills add https://github.com/marumo333/atrox --skill crypto-protocol-diagram-marumo333

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Understanding a cryptographic protocol's message flow requires manually tracing sends, receives, and crypto operations across source code or dense specification documents, which is slow and error-prone. This Skill automates that extraction and produces accurate, cryptographically annotated sequence diagrams. ## Core Features & Use Cases - Dual input paths: Extracts protocol semantics from source code (Python, Rust, Go, TypeScript, C++) or from specifications including RFCs, academic papers, informal prose, ProVerif (.pv), and Tamarin (.spthy) models. - Cryptographic annotation: Labels every key generation, DH/ECDH, KDF, signing, verification, encryption, and commitment operation on the correct party, with abort paths shown as alt blocks. - Canonical protocol patterns: Ships reference flows for TLS 1.3, Noise, Signal X3DH, Double Ratchet, FROST, Shamir secret sharing, and generic MPC to validate implementations against specs and flag divergences. - Use Case: Given a ProVerif model of an HMAC challenge-response protocol, the Skill extracts parties, message flow, and crypto operations, then writes a Mermaid sequenceDiagram file plus an inline ASCII diagram with a protocol security summary. ## Quick Start Ask the AI to diagram the cryptographic protocol in your source file, RFC, or ProVerif/Tamarin model and it will produce a Mermaid sequence diagram file and an inline ASCII diagram.

Frequently Asked Questions about crypto-protocol-diagram

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a sequence diagram from a cryptographic protocol implementation?▼

Point the Skill at your source directory and it greps for handshake, session, and send/recv entry points, traces message flow between parties, and annotates each cryptographic operation. It writes a Mermaid sequenceDiagram file and prints an ASCII diagram inline.

Can I diagram a protocol from an RFC or academic paper instead of code?▼

Yes, the spec workflow handles RFCs, academic papers, pseudocode, and informal prose. It extracts parties from notation sections, message flow from arrow patterns and numbered steps, and crypto operations from key schedule sections.

Does it support ProVerif and Tamarin formal verification models?▼

Yes, ProVerif .pv and Tamarin .spthy files are treated as specifications. The Skill maps out/in channel pairs and In/Out facts to message arrows, and annotates that Tamarin uses the Dolev-Yao adversary network model.

What is the difference between crypto-protocol-diagram and diagramming-code?▼

crypto-protocol-diagram extracts protocol semantics such as who sends what to whom and which cryptographic transformations occur, while diagramming-code visualizes code structure like call graphs, class hierarchies, and module dependencies.

When should I not use this protocol diagramming approach?▼

Do not use it for call graphs or module dependency maps, for formally verifying a protocol, or when the input has no cryptographic protocol semantics such as parties exchanging messages. Use mermaid-to-proverif for verification after diagramming.

How does it handle divergences between a specification and its implementation?▼

When both a spec and code are provided, the Skill runs the spec workflow first to build a canonical diagram, then reads the code and annotates any divergences with a warning marker, such as a missing MAC required by the spec.