Langsung ke konten
Skillpedia
Keamanan8.0k ยท #12730

mermaid-to-proverif

Fungsinya

Skill ini mengonversi diagram sequence Mermaid dari protokol kriptografi menjadi berkas model ProVerif. Skill ini untuk insinyur keamanan yang ingin memeriksa desain protokol dengan verifikasi formal.

Kapan dipakai

  • โœ“Saat Anda punya diagram Mermaid dari protokol kripto dan ingin memverifikasinya secara formal.
  • โœ“Saat Anda perlu memeriksa properti seperti kerahasiaan, autentikasi, atau forward secrecy.
  • โœ“Saat Anda ingin memeriksa desain protokol untuk serangan replay.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/trailofbits/skills/blob/main/plugins/trailmark/skills/mermaid-to-proverif/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œUbah diagram protokol ini menjadi model ProVerif agar saya bisa memeriksa bahwa kunci tetap rahasia.โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill ini membaca pesan dan langkah kripto dalam diagram, lalu menulis berkas model .pv yang bisa diperiksa oleh alat ProVerif. Skill ini juga menambahkan pemeriksaan keterjangkauan sebagai tes kewarasan.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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

Pertanyaan umum

Apakah perlu skill diagram dulu?

Biasanya ya. Skill diagram protokol kripto membuat diagram Mermaid yang dibaca oleh skill ini.

Apakah skill ini menjalankan ProVerif untuk saya?

Tidak. Skill ini menulis berkas model, yang kemudian Anda jalankan sendiri dengan ProVerif.

Properti apa yang bisa diperiksa?

Skill ini dirancang untuk kerahasiaan, autentikasi, dan forward secrecy, serta pemeriksaan serangan replay.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
8.0k
Peringkat
#12730
Lisensi
CC-BY-SA-4.0
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa