AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

crypto-protocol-diagram

Extracts protocol message flow from source code, RFCs, academic papers, pseudocode, informal prose, ProVerif (.pv), or Tamarin (.spthy) models and generates Mermaid sequenceDiagrams with cryptographic annotations. Use when diagramming a crypto protocol, visualizing a handshake or key exchange flow, extracting message flow from a spec or RFC, diagramming a ProVerif or Tamarin model, or drawing sequence diagrams for TLS, Noise, Signal, X3DH, Double Ratchet, FROST, DH, or ECDH protocols.

Original source
trailofbits
License
CC-BY-SA-4.0
Pinned revision
2be6433b39e009cd2b6fd3be1895f6b1faa5af9a

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

This skill also requires local files or dependencies. Remote reading alone may not be enough.

Ask your assistant

Use Agentic Memory skills to read trailofbits--crypto-protocol-diagram at revision 2be6433b39e009cd2b6fd3be1895f6b1faa5af9a, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 7

references/ascii-sequence-diagram.md

ASCII Sequence Diagram Reference

Rules for drawing ASCII sequence diagrams inline in responses.

Column Layout

Lay out participants as column headers, each above a vertical | lifeline. Space columns ~28–32 characters apart so labels fit without wrapping:

Initiator                 Responder
   |                         |
   |                         |

For three or more participants, extend the layout rightward:

Client          Server          CA
   |               |             |
   |               |             |

Arrow Conventions

| Element | Syntax | Use for | |---------|--------|---------| | Request (→) | +------> | message send | | Reply (←) | <- - - -+ | response / reply | | Lost / async | +------x | dropped message |

  • Sending end: +
  • Receiving end: > (rightward) or < (leftward)
  • Solid lines --- for sends; dashed - - - for responses/replies
  • Label goes on the arrow line, positioned between the two lifelines
   |                         |
   +------------------------>|  epk_I
   |                         |
   |  epk_R, Enc(k, cert_R)  |
   |<- - - - - - - - - - - - +
   |                         |

Self-Loops (Local Computation)

For operations that happen at a single party without sending a message:

   |                         |
   +--.                      |
   |  | Sign(sk, transcript) |
   |<-'                      |
   |                         |

Phase Labels

Group related steps under a phase label:

   |   -- Key Exchange --    |
   |                         |
   +------------------------>|  epk_I
   |                         |

Abort / Error Paths

Place abort paths after the main flow, separated by a blank line:

   |   [on auth failure]     |
   |  abort(AUTH_FAILED)     |
   |<- - - - - - - - - - - - +

Width and Labels

  • Keep lines under ~60 characters wide
  • If a label is too long, abbreviate it (e.g. Enc(k,id||σ)) and add a legend below the diagram explaining the abbreviations

Inline Output Format

Protocol: <Name>
Output:   <filename>

<Participant1>            <Participant2>
   |                         |
   ...

## Protocol Summary

- **Parties:** ...
- **Round complexity:** ...
- **Key primitives:** ...
- **Authentication:** ...
- **Forward secrecy:** ...
- **Notable:** none