This repository contains the Rocq mechanization of strand spaces. It includes the full mechanization of the strand framework, new general results about strands and three case studies with a number of variants, as detailed in the paper:
"Strands Rocq: Why is a Security Protocol Correct, Mechanically?" by Matteo Busi, Riccardo Focardi, and Flaminia Luccio (arXiv version)
📣 You can run StrandsRocq directly in your browser, without installing anything!
📄 If you wish, you can download StrandsRocq locally and use your favorite editor to check the proofs interactively. For a complete build of StrandsRocq, you can simply run:
$ dune clean
$ dune build
A successful build requires dune>=3.20, Rocq 9.1.0, and the compatibility package coq-core that can be installed with opam install coq-core.
The process requires about 20 seconds on a machine with an Apple M2 processor.
- Our paper explains the ideas and design principles behind StrandsRocq, and includes some examples;
- For a more hands-on introduction you may also want to consider our online tutorial;
- If you are interested in StrandsRocq's internals there's an AI-generated wiki (
⚠️ May include errors!⚠️ )
If you plan citing our work, you can use the following bib entry:
@inproceedings{strandsrocq,
author = {Matteo Busi and
Riccardo Focardi and
Flaminia L. Luccio},
title = {Strands Rocq: Why is a Security Protocol Correct, Mechanically?},
booktitle = {38th {IEEE} Computer Security Foundations Symposium, {CSF} 2025, Santa
Cruz, CA, USA, June 16-20, 2025},
pages = {33--48},
publisher = {{IEEE}},
year = {2025},
doi = {10.1109/CSF64896.2025.00022}
}
Thanks for your interest in contributing, you can get started here.
The project is structured as follows:
Commonthis folder contains the Rocq mechanization of the common abstract structures of strand spaces:Strands.vis the entry point of the strands formalization, with all the basic definitions;StrandTactics.vinclude the tactics that help in automating the proofs;Bundles.vandBundleRelations.vinclude definitions and facts about bundles;MinimalMPT.vgeneralization of concepts ideas from the paper about minimal elements of sets of terms;RelMinimal.vsmall helper library with facts about minimal elements of setsLogicalFacts.vsubset ofFSetLogicalFacsmodule fromFSetDecide.vin the standard Rocq library.
Instancesthis folder includes the part of the development that concretely instantiates various modules from theCommonfolder:StrandList.vinstantiates strands as pairs(nat * list sT). The first element serves as a strand identifies, the second represents the actual trace of the strand.UTerms.vandPenetrator.vactual instances of Strand's terms and Dolev-Yao intruder, building on top ofStrandsList;UTermsTactics.vandUTermTacticsTests.vtactics (and corresponding test suite) for terms onUniversesdescribed withinStrandsList;DefaultInstances.vis a file with default implementation of the module types as used in the case studies.
Examplesincludes our case studies:simple_authis the full development of Section III of the papernslandns_originalcorrespond to the development of Needham-Schroeder and Needham-Schroeder-Lowe protocols;kmpis for the key management policies case study.
Here we reconstruct the correspondence between the concepts presented in the paper and those mechanized here. Notice that the mechanization includes a lot of details that are omitted in the paper, hence we encourage the interested reader to inspect the proof with their favorite editor.
| Paper | Rocq code |
|---|---|
| Strand spaces and bundles | Common/Strands.v and Common/Bundles.v |
| Terms | 𝔸 in Instances/UTerms.v |
| Subterm relation | subterm in Instances/UTerms.v |
| Penetrator | penetrator_trace in Instances/Penetrator.v |
| Bound on penetrator power | penetrator_bound in Instances/Penetrator.v |
| (Uniquely) originates | originates and uniquely_originates in Common/Strands.v |
| Proof technique facts | Sec. BundleMinimal in Common/Bundles.v |
| Paper | Rocq code |
|---|---|
| Sec. B, C | Examples/simple_auth/SimpleAuth.v |
| Sec. D, Replacing A with B in the ciphertext | Examples/simple_auth/SimpleAuthWithB.v |
| Sec. D, A flawed version of the protocol | Examples/simple_auth/SimpleAuthFlawed.v |
| Sec. D, Relaxing the term typing | Examples/simple_auth/SimpleAuthUntyped.v |
| Sec. E | Examples/simple_auth/SimpleAuthDual.v and Examples/simple_auth/SimpleAuthDualBProtected.v |
| Sec. F | Examples/simple_auth/SimpleAuthMaximalEnc*.v |
| Paper | Rocq code |
|---|---|
| Protocol definitions | Examples/nsl/NSL_protocol.v, Examples/nsl/NSL_initiator.v, and Examples/nsl/NSL_responder.v |
| Responder authentication guarantees (classical and new proof technique) | Examples/nsl/NSL_auth_responder.v and Examples/nsl/NSL_auth_responder_simple.v |
| Responder secrecy guarantees (classical and new proof technique) | Examples/nsl/NSL_secrecy_responder.v and Examples/nsl/NSL_secrecy_responder_simple.v |
| Initiator authentication guarantees | Examples/nsl/NSL_auth_initiator.v |
| Initiator secrecy guarantees | Examples/nsl/NSL_secrecy_initiator.v and Examples/nsl/NSL_secrecy_initiator_simple.v |
| Original NS protocol | Examples/original_ns |
| Paper | Rocq code |
|---|---|
| Basic definition | Examples/kmp/KMP_protocol.v |
| Typed key management policies | Examples/kmp/KMP_policies.v |
| Security properties | Examples/kmp/KMP_closure.v and Examples/kmp/KMP_secrecy.v |
