본문으로 건너뛰기
Skillpedia
보안8.0k · #12730

mermaid-to-proverif

하는 일

암호 프로토콜의 Mermaid 시퀀스 다이어그램을 ProVerif 모델 파일로 바꿉니다. 형식 검증으로 프로토콜 설계를 확인하려는 보안 엔지니어를 위한 것입니다.

사용하는 경우

  • ✓암호 프로토콜의 Mermaid 다이어그램이 있고 그것을 형식적으로 검증하고 싶을 때.
  • ✓비밀성, 인증, 순방향 비밀성 같은 속성을 확인해야 할 때.
  • ✓재생 공격에 대해 프로토콜 설계를 확인하려는 경우.

스킬 링크

https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/mermaid-to-proverif/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/mermaid-to-proverif/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 프로토콜 다이어그램을 ProVerif 모델로 바꿔서 키가 비밀로 유지되는지 확인해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 다이어그램의 메시지와 암호 단계를 읽고, ProVerif 도구가 확인할 수 있는 .pv 모델 파일을 씁니다. 또한 기본 점검으로 도달 가능성 검사를 추가합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Mermaid to ProVerif

Reads a Mermaid sequenceDiagram describing a cryptographic protocol and produces a ProVerif model (.pv file) that can be passed directly to the ProVerif verifier.

Tools used: Read, Write, Grep, Glob.

The typical input is the output of the crypto-protocol-diagram skill — a Mermaid sequenceDiagram annotated with cryptographic operations (Sign, Verify, DH, HKDF, Enc, Dec, etc.) and message arrows.

When to Use

  • User asks to formally verify a cryptographic protocol described as a Mermaid sequenceDiagram
  • User wants to generate a ProVerif model (.pv file) from a protocol diagram
  • User wants to prove secrecy, authentication, or forward secrecy properties
  • Input is the output of the crypto-protocol-diagram skill

When NOT to Use

  • No Mermaid sequenceDiagram exists yet — use crypto-protocol-diagram first to generate one
  • User wants to verify properties of non-cryptographic systems (state machines, access control)
  • User wants to run ProVerif on an existing .pv file — just run proverif model.pv directly

Rationalizations to Reject

Rationalization Why It's Wrong Required Action
"Reachability queries are just busywork" If events aren't reachable, all other query results are meaningless Always add reachability queries first as a sanity check
"Public channels are fine for all messages" Private channels for internal state prevent false attacks Use private channels for intra-process state threading
"I'll skip the forward secrecy test" Ephemeral keys demand forward secrecy verification Add the ForwardSecrecyTest process whenever the diagram shows ephemeral keys
"Unused declarations are harmless" ProVerif may report spurious results from orphan declarations Clean up all unused types, functions, and events
"The model compiles, so it's correct" A compiling model can have dead receives, type mismatches, or impossible guards that make queries vacuously true Validate reachability before trusting any security query
"I don't need to check the example first" The example defines the expected output quality bar Study examples/simple-handshake/ before working on unfamiliar protocols

Workflow

ProVerif Model Progress:
- [ ] Step 1: Parse participants and channels
- [ ] Step 2: Inventory cryptographic operations
- [ ] Step 3: Declare types, functions, and equations
- [ ] Step 4: Identify and declare events
- [ ] Step 5: Formulate security queries
- [ ] Step 6: Write participant processes
- [ ] Step 7: Write main process and finalize
- [ ] Step 8: Verify and deliver

Step 1: Parse Participants and Channels

From the Mermaid diagram:

  1. Extract every participant or actor declaration. Each becomes a ProVerif process.
  2. Count message arrows (->>, -->>, -x, --x). Each distinct A ->> B: label creates a communication step on a channel.
  3. Decide channel model:
    • Public channel for any message sent over the network before a secure channel is established (e.g., ClientHello, ephemeral keys, ciphertext to be decrypted by the peer).
    • Private channel only for internal state threading within a single party process (not for cross-party messages).
    • Default: declare one shared public channel c for all cross-party messages. Add per-flow channels only when two distinct parallel sessions must be independent.
free c: channel.

Step 2: Inventory Cryptographic Operations

Walk through every Note over annotation and message label. Build a list of all distinct operations used. Map each to a ProVerif declaration category:

Mermaid annotation ProVerif category
keygen() → sk, pk New name (new sk), public key derived via function
DH(sk_A, pk_B) DH function or exp with group
Sign(sk, msg) → σ Signature function
Verify(pk, msg, σ) Equation or destructor
Enc(key, msg) → ct Symmetric or asymmetric encryption function
Dec(key, ct) → msg Destructor (equation)
HKDF(ikm, info) → k PRF/KDF function
HMAC(key, msg) → tag MAC function
H(msg) → digest Hash function
Commit(v, r) → C Commitment function
Open(C, v, r) Commitment equation

Consult references/crypto-to-proverif-mapping.md for exact ProVerif syntax for e

자주 묻는 질문

먼저 다이어그램 스킬이 필요한가요?

보통 그렇습니다. 암호 프로토콜 다이어그램 스킬이 이 스킬이 읽는 Mermaid 다이어그램을 만듭니다.

스킬이 ProVerif를 대신 실행하나요?

아니요. 모델 파일만 쓰며, 그것을 ProVerif로 직접 실행합니다.

어떤 속성을 확인할 수 있나요?

비밀성, 인증, 순방향 비밀성을 위해 설계되었으며, 재생 공격 검사도 포함됩니다.

상세 정보

작성자의 원본 설명

Translates Mermaid sequenceDiagrams describing cryptographic protocols into ProVerif formal verification models (.pv files). Use when generating a ProVerif model, formally verifying a protocol, converting a Mermaid diagram to ProVerif, verifying protocol security properties (secrecy, authentication, forward secrecy), checking for replay attacks, or producing a .pv file from a sequence diagram.

repo: trailofbits/skills

인기도

GitHub 스타
8.0k
순위
#12730
라이선스
CC-BY-SA-4.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬