Manuscript Offprint
arXiv:2611.09315Verification of Security Properties of Cryptographic Protocols
Simona Bernardi¹[0000-0002-2605-6243] and Joaquín Ezpeleta¹[0000-0002-9622-8186]
Universidad de Zaragoza, Spain {simonab,ezpeleta}@unizar.es
Abstract. Developing cryptographic protocols that are free from vulnerabilities is very challenging, as evidenced by numerous design flaws and implementation bugs in widely used protocols. Recent work has leveraged model checking to generate negative test cases, that is test cases that include the behavior of Dolev-Yao attacker. In this paper, we address the problem of analyzing execution traces produced by testing protocol implementations with such negative test cases. We propose a method for detecting violations of security properties by model-checking execution traces. Our approach employs a model checker based on DLTL, a Linear Temporal Logic with freeze operators, and supports automation of the testing process through pre- and post-processing steps. These steps, respectively, bridge the gap between different levels of abstraction and synthesize the results produced by the model checker. We present experimental results as a proof of concept for the feasibility of the proposed method.
Keywords: Cryptographic protocols · Security properties · DLTL · Testing
1 Introduction
Developing cryptographic protocols free from vulnerabilities is very challenging. Many protocols have been repeatedly found to contain design flaws and implementation bugs [15]. Symbolic techniques have been successfully applied primarily to the verification of cryptographic protocols in their early stages enabling the identification of vulnerabilities exploitable by Dolev-Yao attacks [5], where the attacker has full control over the network. The main drawback of tools supporting symbolic analysis is their limited scalability [5], which can make the verification of real-world case studies extremely time-consuming.
At later stages of development, recent works have leveraged model checking to generate test cases for protocol implementations [11,16]. In particular, in [11]
Preprint notice: This is an author-accepted manuscript of a paper accepted for publication in the proceedings of EICC 2026. © Springer.
a method is proposed for generating negative test cases, i.e., test cases that incorporate the Dolev-Yao intruder. A negative test case is automatically derived from counterexamples generated by model checking protocol specifications against security goals, such as secrecy and authentication.
In this paper, we build on [11] and take a step further by addressing the problem of analyzing execution traces produced by testing protocol implementations with such negative test cases. Specifically, we propose a method to determine whether the implementation pass or not a test case by verifying the execution traces against a security goal defined in the original protocol specification. This technique can serve as an alternative when symbolic techniques are impractical, for instance due to time constraints.
The analysis is conducted using a model checker based on DLTL logic [9], an extension of LTL that allows the specification and evaluation of properties involving relations between attribute values across different states. Given a protocol execution trace and a DLTL formula encoding the violation of a security goal, the model checker verifies whether the formula is satisfied by the trace.
The proposed method facilitates automation of the testing process by including pre/post-processing steps. Pre-processing of execution traces establishes the mapping between the bitstrings in exchanged messages and the assets in the security goals. Besides, post-processing of the model checking results enables the test outcome to be interpreted in terms of the security goal and, when the goal is violated, allows for the identification of the specific traces that breach the property. As a proof of concept, we have developed a tool that has been used in the experiments with a set of protocols from the AnBx library [3].
The paper is organized as follows: the rest of this section reviews briefly the related work; Section 2 gives an overview of the approach; Section 3 defines the DLTL model and formulas for checking security properties; Section 4 describes trace checking workflow supported by the goal_checker tool; Section 5 reports the results from the experiments; and Section 6 provides conclusions and future work.
Besides, various frameworks have been developed to assist non-experts in formal methods by providing user-friendly languages for specifying protocols and security properties, while also integrating multiple analysis tools as backends [4,10]. In particular, AnBx [10] supports the specification of protocols and properties in “Alice&Bob” formal languages [8], and includes OFMC as a backend. Additionally, the AnBx framework provides model-to-code generation features [13] for rapid Java prototyping. This feature is leveraged in the approach proposed in this work to generate negative test cases.
Formal methods have been mainly used in the verification of cryptographic protocol specifications at design stage. Recent proposals leverage them for fuzzing or runtime verification [2,14]. Both works make use of formal logics, similar to the linear temporal logic used in the Tamarin tool [6], to express security properties: in [2], the logic is used to guide the fuzzer in identifying violations of security properties caused by Dolev-Yao attacks; in [14], it is used to monitor protocol execution and detect potential violations of security properties. Although our work differs in focus from [2,14], it shares a common challenge: coping with different levels of abstraction, particularly between the specification of security properties and the observation of concrete execution traces.
Linear Temporal Logic (LTL) is a formalism used to specify and reason about the behavior of systems over time, where properties are expressed along a single trace (a linear sequence of states or events). It introduces temporal operators such as X (neXt), F (Eventually), G (Globally), and U (Until) to describe how propositions evolve across future points in the trace [12].
Alur and Henzinger introduced Timed Propositional Temporal Logic (TPTL) [1], which augments LTL with freeze quantifiers, a mechanism that allows one to bind a variable to a state and subsequently compare these frozen state values with later states, within a temporal formula. This makes TPTL capable of expressing data-dependent temporal constraints, whereas standard LTL only reasons about Boolean propositions without memory of specific values. Thus, TPTL with freeze operators is strictly more expressive than classical LTL. DTL logic [9] adopts the same perspective as TPTL, but adapting it to the case of finite traces, and also adding past operators.
2 Approach Overview
Figure 1 shows the overall approach for testing security properties of cryptographic protocols with checking of execution traces. Our approach relies upon the AnBx framework [13] and, in particular, the Alice&Bob protocol narration as input specification (AnB) and the automatic generation of a protocol Java-based implementation.
Given an initial AnB specification of a protocol and a goal to be verified , a set of negative test cases is considered. Each test case is an AnB specification that, besides the original actors and goal, includes an intruder who may invalidate the property of interest. A test case can be semi-automatically generated (Test cases generation): indeed, the AnBx framework already provides support to automatically generate test cases [11] albeit only for a subset of attack scenarios, due to the limited expressivity of the Alice&Bob languages. Similarly, a Java-based implementation of a test case can be semi-automatically generated with the AnBx framework (Model-2-code generation).

Fig. 1. Workflow and dataflow of the overall approach
The goal checker workflow, emphasized by the dotted rounded rectangle, addresses the verification of the goal through DLTL checking of the protocol execution traces and it is the focus of this paper.
The Java-based implementation of a negative test case is used to launch a protocol simulation and log the execution traces: a trace represents the execution of a session of the protocol. Then, the execution traces are pre-processed to get a structured log and the goal as DLTL formula (i.e., goal violation), which are fed to the DLTL model checker. The latter produces outcomes for each trace in the log against the DLTL security property: the results are finally synthesized to summarize the outcome of the verification of the log against of the original goal. A list of traces in the log that violated the goal are listed in the summary.
3 Specification and Verification with DLTL
To verify that protocol executions comply with their intended specifications, we employ DLTL [9]. In our context, a trace is defined as a chronologically ordered sequence of events representing a protocol's execution. Each event encapsulates the metadata of a communication action, such as the participating agents, the action type, and the associated parameters, represented as typed attributes.
As we will demonstrate, protocol requirements often go beyond simple sequences of actions, requiring the correlation of attribute values across different states in the trace. For instance, a property might specify that a nonce identifier captured during an initial event must be identical to the identifier appearing in a subsequent event.
By utilizing freeze operators, we can evaluate these cross-temporal properties without prior knowledge of the data domain (e.g., the set of all possible nonce
IDs). While traditional LTL would require a distinct proposition for every possible value, leading to an unmanageable or even infinite state space, freeze operators allow us to bind an event to a variable and perform direct comparisons later in the trace. This makes this kind of logic to be well-suited for verifying protocols where the specific data values are not known in advance, but the consistency of those values is critical.
3.1 DLTL Model
The DLTL model is the ordered sequence of events , where each corresponds to the event of the log and is a tuple of the form:
Each element of the tuple corresponds to an attribute as shown in Table 1: in particular, is the action ( is the set of actions, described in Table 2), and are the session and step numbers respectively, and are the active and passive participants, @ is the message content, and is the type of the message.
| Attribute | Description | DLTL Domain |
|---|---|---|
| session | Number of the session | integer |
| step | Number of the step | integer |
| active | Concrete agent who performs the action | string |
| passive | Concrete agent who is involved in the action | string |
| action | Type of action (cfr. Table 2) | atomic proposition |
| mess | Content of the message | set of strings |
| type | The type of the message | string |
Table 1. Event attributes.
The possible actions are listed in Table 2. In addition to the send and receive actions, the remaining ones are related to message preparation on the sender side or post-processing on the receiver side.
3.2 DLTL Formulas
In this paper, we use DLTL formulas to represent goal violations. Depending on the goal a different DLTL formula is set as detailed in the following.
| Action | Description |
|---|---|
| sent | A message is sent |
| received | A message is received |
| generateNumber* | The active participant generates a fresh value |
| AnBx_Params | The active participant prepares the message content to be sent |
| eq_check* | The active participant verifies the message content with an equality check |
| inv_check* | The active participant verifies the message content with a crypto-operation (e.g., decryption) or a projection operation followed by another check (e.g., extracts an element of the tuple and performs an equality check) |
*It can be postfixed with the name of an asset (Agent or Number type) in the AnB specification.
Table 2. Type of actions in the events of a trace.
Authentication. Let us consider the goal "A authenticates B on N", where A and B are two agents and N is an asset exchanged in the protocol. The authentication goal is violated when B does not agree on N or eventually A is not able to recover N. The DLTL formula (1) expresses such a violation:
where and are boolean functions: the former returns true if and only if there is an event where can compose , the second returns true if and only if there is an event where can recover and the agreed and recovered values are equal. Formally:
The propositions can_composeN and can_recover are defined in Table 3. In particular, can_composeN is defined as the disjunction of three actions listed in Table 2, each postfixed with the name of the asset included in the goal, i.e., N. Depending on the protocol specification, one of these actions corresponds to the event in which B either generates or recovers the asset.
In case of a goal including several assets, i.e., "A authenticates B on N_1, ..., N_n", the DLTL formula is generalized as follows:
Secrecy. Let us consider the goal "N secret between A_1, ..., A_m", where A_1, ..., A_m is a set of m agents and N is an asset exchanged in the protocol. The secrecy goal is violated if one agent of the set generates N and someone
| Function | Definition |
|---|---|
| can_composeN | |
| can_recover | |
| generatesN | |
| can Decrypt |
Table 3. Component boolean functions
different from the agents in the set can read N. The DLTL formula (5) expresses such a violation:
where generates(z) and leaked(z,y) are boolean functions: the former returns true if and only if there is an event where an agent from the set is generating N, and the latter returns true if and only if there is an event where an agent R, with , can successfully decrypt N. Formally:
The propositions generatesN and can Decrypt are defined in Table 3. The former denotes the nonce-generation action listed in Table 2, postfixed with the name of the asset included in the goal, i.e., N. The latter identifies the event in which a decryption operation is successfully performed and the resulting message is not sealed.
4 The Goal Checker Workflow
In this section, we describe in detail the steps of the goal checker workflow of Figure 1 together with the Python modules of the tool developed as a support.
4.1 Launch Simulation and Logging
The first step of the workflow aims to produce the execution traces of a negative test case protocol. Our approach relies upon the AnBx framework [13] to generate a Java-based implementation of the protocol. The sim_launcher module is in charge of compiling the protocol and launching it, by running a concurrent process for each protocol agent (i.e., role) and saving the execution traces of each process in a separate textual file. For each role R in the protocol, as many execution traces are generated as the number of sessions specified as configuration parameter: each trace includes a set of ordered events involving the concrete agent playing the role in the protocol (i.e., instantiated value of the role ).
4.2 Pre-processing of Execution Traces
The execution traces produced by the protocol need to be pre-processed to be fed to the DLTL model checker. This step produces the formatted traces and the DLTL formulas in two sub-steps as follows.
Extract Log and Map Agents to Protocol Roles. In the first sub-step, carried out by the log_extractor module, the execution traces of each role are filtered, considering the type of actions listed in Table 2. The filtered execution traces of the roles are then merged together to get a unique log, where the events are ordered according to the session number (i.e., trace identifier) and the number of the step. In particular, the latter corresponds to the number of the action in the AnB specification of the protocol. Then, the events in the log are formatted and unique identifiers are assigned to asset values as well as to encrypted messages.
Listing 1.1. Excerpt of the log produced by the log_extractor
#session,step,active,passive,action,mess,type
1,0,charlie,-,generateNumber,X0,anbxj.CryptoByteArray
1,0,charlie,-,generateNumber,X1,anbxj.CryptoByteArray
1,0,charlie,-,AnBx_Params,X0;bob;X1,anbxj.AnBx_Params
1,0,charlie,alice,sent,03b6eb2ec,java.crypto.SealedObject
1,0,alice,charlie,received,03b6eb2ec,java.crypto.SealedObject
1,0,alice,-,inv_check,0c2e1f26,java.crypto.SealedObject.toString
The Listing 1.1 shows an excerpt of the log produced by the log_extractor from the execution traces of a negative test case. In particular, the logged events correspond to the exchange of a message encrypted with the secret key shared by roles and . The message is a triplet consisting of a nonce , the role name and nonce .
The first three events (lines 2-4) are actions performed by charlie (role ) to prepare the message, i.e., generating the two nonce values X0 and X1, respectively, and setting the triplet , where bob plays the role . The lines 5-6 correspond to the sending and the reception of the encrypted message 03b6eb2ec, where the receiver is alice —who plays the role of the intruder . The last event (line 7) is the action performed by alice, who tries to decrypt the message without success (the inv_check operation returns an encrypted value, i.e., 0c2e1f26).
The log-extractor module is also responsible for mapping the agents in the log to the roles defined in the AnB protocol and for generating the component boolean functions listed in Table 3, taking into account the goal to be verified.
Generate DLTL Model and Formula. In the second sub-step, the dtll_generator module generates both the DLTL model and the DLTL formula. The DLTL model closely resembles the log produced in the first step but conforms to the specific input format required by the DLTL tool. The DLTL formula is generated based on the goal specified in the negative test case.
4.3 Check Traces and Synthesize Results
The dtll_model_checker is in charge of checking the DLTL formula against each trace in the DLTL model. As a result, it produces a boolean value for each trace. In the last step, performed by the res_synthesis module, the results are synthesized in order to have a unique boolean outcome for all the traces in model. In particular, if at least a trace satisfies the formula then the outcome is true and the trace identifier is added to the list of traces violating the goal. Figure 1 shows the synthesized result produced for the negative test case P6_A2 in Table 4, that represents a replay attack, considering a log with ten traces, where two out of ten traces violate the authentication goal.
5 Experiments
As a proof of concept for the feasibility of the proposed method, we have developed a tool that has been validated with a set of protocols from the AnBx library [3]. Table 4, shows the protocols used in the experiments with their original name (column 1) and the goals (column 2). The AnB specification of each protocol has been verified against the goals with OFMC [7], as a result all the protocols are vulnerable to attacks against authentication or secrecy.
For each protocol and goal, we have considered at least a negative test case (column 3) involving an intruder whose behavior is intended to violate the corresponding goal and follows an attack pattern: passive, reading the message in transit; replay, forwarding a received message multiple times across different protocol sessions; reflection receiving a message from a participant and sending it back; mitm, impersonating one or more legitimate parties in the protocol execution. Most of the test cases were generated in an semi-automatic manner with the support of the AnBx tool [11]. Depending on the type of goal, either a single session —for a secrecy goal— or multiple sessions —for an authentication goal— were simulated (column 4).
The last column shows the results, which are consistent with those produced by OFMC. Indeed, for all protocols, the goal_checker finds traces of at least one negative test case that satisfy the DLTL formula associated with the goal—that is, violate the goal. Negative test cases aimed at checking authentication goals have been run for several sessions, i.e., 10 sessions, to assess strong authentication: while checking strong authentication with OFMC is quite time-consuming —even for very few sessions, such as 2 or 3, the time to check is in
Available at: https://github.com/simber72/goal-checker/
| Protocol () | Goal* | Test case (attack type) | Sessions | Results (goal-violating traces) |
|---|---|---|---|---|
| AndrewSecureRPC () | A | P_1__A (replay) | 10 | ✓(2, 3, 4, 5, 8, 10) |
| From_A_and_Back () | S | P_2__S (passive) | 1 | ✓ |
| GSM () | S | P_3__S_1 (passive) | 1 | ✓ |
| P_3__S_2 (mitm) | 1 | ✓ | ||
| NSPK () | S | P_4__S_1 (passive) | 1 | ✗ |
| P_4__S_2 (mitm) | 1 | ✓ | ||
| ISOPK2PMAP () | A1 | P_5__A1 (reflection) | 10 | ✓(all) |
| A2 | P_5__A2 (reflection) | 10 | ✓(2, 4, 6, 8, 10) | |
| ISOSK2PMAP () | A1 | P_6__A1 (replay) | 10 | ✓(2, 4, 9, 10) |
| A2 | P_6__A2 (replay) | 10 | ✓(2, 5) | |
| Kerberos () | A | P_7__A (mitm) | 10 | ✓(all) |
| SSO () | A1 | P_8__A1 (mitm) | 10 | ✓(all) |
| A2 | P_8__A2 (replay) | 10 | ✓(3, 5) | |
| S | P_8__S (mitm) | 1 | ✓ |
- is a secrecy goal and and are authentication goals.
Table 4. Results from the experiments
the order of minutes or greater— the goal_checker takes few seconds to analyze 10 traces.
6 Conclusions
We have presented a method for testing the security properties of cryptographic protocols by model-checking execution traces. The model-checker takes an execution trace and a DLTL formula expressing the violation of a security goal and verifies whether the formula is satisfied by the trace. Pre-processing of execution traces and post-processing of the results facilitate the automation of the testing process.
The experiments were conducted using simple protocols from the AnBx library; as future work, we are planning to apply the method to a real-world case study in the critical infrastructure domain.
Achieving full automation in the generation of negative test cases remains an open challenge, which we are currently working to address. We recognize limitations in the expressiveness of Alice&Bob languages which prevents the specification of negative test cases with attacks that involve multiple protocol sessions (such as replay and reflection attacks), and we aim to overcome them.
Acknowledgments. The authors were supported by the Spanish Ministry of Science and Innovation [ref. PID2020-113969RB-I00, PID2024-159323NB-I00] and by the European Union-Spanish “Agencia Estatal de Investigación” [ref. PID2023-148202OB-C22].
Disclosure of Interests. The authors have no competing interests to declare that are relevant to the content of this article.
Experiments have been conducted using a MacOS laptop with 2,3 GHz Intel Core i7 with 4 kernels.
References
-
Alur, R., Henzinger, T.A.: A Really Temporal Logic. J. ACM 41(1), 181–203 (Jan 1994). https://doi.org/10.1145/174644.174651
-
Ammann, M., Hirschi, L., Kremer, S.: DY Fuzzing: Formal Dolev-Yao Models Meet Cryptographic Protocol Fuzz Testing. In: Proc. of the 45th Symposium on Security and Privacy (S&P'24). IEEE, San Francisco, CA, USA (2024). https://doi.org/10.1109/SP54263.2024.00096
-
AnBx Compiler and Java Code Generator, https://paolo.science/anbx/
-
Armando, A., et al.: The AVISPA tool for the automated validation of internet security protocols and applications. In: Etessami, K., Rajamani, S.K. (eds.) Computer Aided Verification. pp. 281–285. Springer (2005). https://doi.org/10.1007/11513988_27
-
Barbosa, M., et al.: Sok: Computer-aided cryptography. In: Proceedings of the 2021 Symposium on Security and Privacy (S&P'21). pp. 777–795. IEEE CS (2021). https://doi.org/10.1109/SP40001.2021.00008
-
Basin, D., Cremers, C., Dreier, J., Sasse, R.: Symbolically analyzing security protocols using Tamarin. ACM SIGLOG News 4(4), 19–30 (Nov 2017). https://doi.org/10.1145/3157831.3157835
-
Basin, D., Mödersheim, S., Viganò, L.: OFMC: A symbolic model checker for security protocols. Int. J. Inf. Secur. 4(3), 181–208 (2005). https://doi.org/10.1007/s10207-004-0055-7
-
Bugliesi, M., Calzavara, S., Mödersheim, S., Modesti, P.: Security protocol specification and verification with AnBx. Journal of Information Security and Applications 30, 46–63 (2016). https://doi.org/10.1016/j.jisa.2016.05.004
-
Couvreur, J.M., Ezpeleta, J.: A Linear Temporal Logic Model Checking Method over Finite Words with Correlated Transition Attributes. In: Ceravolo, P., van Keulen, M., Stoffel, K. (eds.) Data-Driven Process Discovery and Analysis. pp. 89–104. Springer (2019). https://doi.org/10.1007/978-3-030-11638-5_5
-
Garcia, R., Modesti, P.: A Practical Approach to Formal Methods: An Eclipse Integrated Development Environment (IDE) for Security Protocols. Electronics 13(23) (2024). https://doi.org/10.3390/electronics13234660
-
Garcia, R., Modesti, P.: Automatic generation of security protocols attacks specifications and implementations. Cyber Security and Applications 2 (2024). https://doi.org/10.1016/j.csa.2024.100038
-
Manna, Z., Pnueli, A.: The Temporal Logic of Reactive and Concurrent Systems. Springer-Verlag New York, Inc., New York, NY, USA (1992). https://doi.org/10.1007/978-1-4612-0931-7
-
Modesti, P.: AnBx:: Automatic Generation and Verification of Security Protocols Implementations. In: García-Alfaro, J., Kranakis, E., Bonfante, G. (eds.) Foundations and Practice of Security. LNCS, vol. 9482, pp. 156–173. Springer (2016). https://doi.org/10.1007/978-3-319-30303-1_10
-
Morio, K., Künnemann, R.: SpecMon: Modular Black-Box Runtime Monitoring of Security Protocols. In: Proc. of the 2024 on ACM SIGSAC Conference on Computer and Communications Security. pp. 2741–2755. ACM, New York, NY, USA (2024). https://doi.org/10.1145/3658644.3690197
-
NIST: National Vulnerabilities Database. https://nvd.nist.gov/
-
Yao, J., et al.: A model checking-based framework for testing security properties of protocols under development. Computer Networks 265 (2025). https://doi.org/10.1016/j.comnet.2025.111259