Manuscript Offprint
arXiv:2611.07170Global Surveillance Under the Lens: Reconstructing Passive Dolev-Yao Intruders
Abstract
Global surveillance systems record large volumes of network traffic for retrospective analysis, but packet captures alone reveal little about protocol-level semantics. This paper presents an automated, specification-guided methodology for reconstructing passive Dolev-Yao intruder executions from captured network traffic and validating the reconstructed executions against a formal protocol specification. The framework takes a PCAP capture, an AnBx specification, and the associated deployment metadata; it extracts Java-serialised objects from TCP streams, reconstructs protocol sessions and channel-to-step assignments, and generates a passive intruder that evaluates the Dolev-Yao-derived checks produced by the AnBx compiler. Three reconstruction challenges are addressed: multiple serialised objects and object references within a TCP stream, ambiguity in mapping interleaved connections to concurrent protocol sessions, and semantic validation of candidate reconstructions. We evaluate the methodology on 121 protocols from the AnBx test suite. For single-session captures, the standard JDK cryptographic provider recovers 97.8% of expected objects and achieves 94.2% successful reconstruction, where success requires complete object recovery and a clean passive-intruder execution. For the 112 parallel-capable protocols, the toolchain achieves 89.3% successful reconstruction for both two and three concurrent sessions, while recovering approximately 97.2% of expected objects. Experiments with mismatched protocol-role mappings and deliberately mutated traces show that the generated Dolev-Yao checks respond to semantic inconsistencies. By making the reconstruction step explicit, the solution produces protocol-level observations on which assessments of protocol resilience and the design of defensive countermeasures can be built.
Keywords: Security protocols, Passive adversary, Dolev-Yao model, Attack reconstruction, PCAP analysis, AnBx
Email address: p.modesti@tees.ac.uk (Paolo Modesti)
1. Introduction
Global surveillance programmes, as disclosed by Edward Snowden in 2013 [1], have fundamentally altered our understanding of privacy and communication security. Snowden's revelations exposed a vast ecosystem of state surveillance, largely operated by the US National Security Agency (NSA) and its partners in the Five Eyes intelligence alliance. These programmes included PRISM (collection from major US technology companies), UPSTREAM (interception on the internet backbone), and XKEYSCORE (real-time interception of user activity). Others, such as BULLRUN (undermining encryption standards), MUSCULAR (infiltrating the private data links between Google and Yahoo data centres), and QUANTUMINSERT (targeted exploitation via network packet injection), further demonstrate the scale and sophistication of these operations. State actors systematically intercept, store, and analyse private communications, often exploiting protocol-level vulnerabilities. The threat is not merely theoretical: surveillance capabilities are used to bypass encryption, harvest metadata, and retroactively decrypt captured traffic when cryptographic keys become compromised [2]. These practices challenge the confidentiality and integrity of digital communication, with profound implications for privacy, economic security, and democratic governance. The economic cost of this threat has been quantified by Blanco-Romero et al. [3], who demonstrate that storing intercepted ciphertext is economically trivial for state-level actors over multi-decade timeframes.
Our work contributes a concrete, automated mechanism for analysing the technical underpinnings of such surveillance: specifically, enabling systematic assessment of the information that captured protocol executions expose to a passive observer.
In contrast, many real-world surveillance scenarios are passive. An adversary silently records network traffic, storing encrypted communications for later decryption when keys become available, or exploits weaknesses in key exchange protocols to compromise forward secrecy in practice [8]. This harvest now, decrypt later strategy [3] is particularly concerning for protocols lacking forward secrecy. Despite its practical relevance, the passive intruder has received comparatively little attention in the formal methods literature, with notable exceptions [9, 10], and remains underexplored in the context of network trace analysis. Existing verification tools do not directly support the analysis of captured traffic against protocol specifications. Verification tools can synthesise symbolic attacks, but cannot validate whether a concrete network trace corresponds to a protocol execution or an attack. Network forensics tools (e.g., Wireshark [11]) display packet contents but lack the semantic understanding required to determine whether a captured trace corresponds to a valid protocol run or contains evidence of a security violation.
Approach and Contributions
This paper presents an automated, specification-guided methodology for reconstructing passive Dolev-Yao intruder executions from captured network traffic. The framework takes as input a PCAP file (captured under a man-in-the-middle configuration where the intruder passively relays messages), a protocol specification in the AnBx language [12], and the associated deployment metadata (in our implementation, a configuration file generated by the compiler), and produces executable Java code that reconstructs the captured trace. The Dolev-Yao knowledge analysis is performed by the AnBx compiler [13] at compilation time and materialised as receive-side checks in the generated intruder role; the reconstruction stage supplies concrete observations to these checks, rather than performing symbolic deduction at run time. The generated checks are consistency conditions on the captured trace, not a proof of security (Section 2.3).
Our methodology extends the AnBx compiler [14] with a reconstruction pipeline (Figure 5) that (1) extracts serialised Java objects from each TCP stream, preserving object graphs via TC_REFERENCE markers by reading complete streams; (2) pairs bidirectional streams into connections, groups connections into sessions, and enumerates candidate channel assignments when a connected component contains multiple interleaved sessions; (3) maps extracted objects to protocol steps via the compiler-generated channel-to-step map, resolving streams that carry more than one object; (4) generates a passive intruder role that reads the reconstructed step files and performs the compiler-derived defensive checks; and (5) scores each candidate arrangement by the number of clean sessions and passed checks, selecting the best-scoring one. The intruder does not modify messages; it observes, validates, and reconstructs them, faithfully modelling a passive adversary.
We evaluate the framework on a test suite of 121 protocols drawn from the OFMC distribution [5] that ships with the AnBx toolchain and from the SET [15] and iKP [16] families. The pipeline recovers 97.8% of expected objects at and achieves 94.2% successful reconstruction; on the 112 parallel-capable protocols it achieves 89.3% at both and . Detailed metrics, including a comparison between the JDK and Bouncy Castle providers, are reported in Section 4.
The contributions of this paper are fourfold. First, a concrete operational instantiation of a passive Dolev-Yao intruder in which the compiler's symbolic knowledge analysis is materialised as executable receive-side checks over reconstructed observations. Second, a PCAP-to-protocol reconstruction pipeline that extracts Java-serialised objects, preserves object-stream semantics, maps objects to protocol steps, and resolves interleaved sessions through candidate enu-meration. Third, specification-guided candidate selection, in which Dolev-Yao-derived consistency checks distinguish competing reconstructions of the same captured traffic. Fourth, an evaluation over 121 protocols assessing behaviour under multiple sessions, alternative cryptographic providers, third-party Java traffic, mismatched protocol-role mappings, and deliberately mutated traces. The purpose of the surveillance framing is defensive: the framework makes explicit what a passive adversary can recover from captured traffic, so that the resulting knowledge can inform the design of protocols that are more resilient to retrospective analysis. The prototype does not model a complete intelligence-collection system or infer unknown protocols from arbitrary traffic; it provides a controlled laboratory model of one stage of retrospective surveillance analysis, and a basis for assessing which protocol design choices reduce the information recoverable after interception.
Outline of the Paper
The paper is organised as follows. Section 2 reviews the Dolev-Yao model, the AnBx language, the compiler pipeline, and relevant background on Java serialisation and PCAP processing. Section 3 presents the reconstruction workflow from PCAP to executable Java code. Section 4 reports the experimental results, Section 5 discusses them and their limitations, and Section 6 discusses related work. Section 7 concludes and outlines future work.
2. Background
This section introduces the essential background for understanding our passive intruder reconstruction framework. We begin by defining the Dolev-Yao model with a specific focus on the passive adversary. We then present the AnBx specification language and the compiler pipeline that transforms abstract protocol descriptions into executable Java code. Finally, we discuss Java serialisation, the technical foundations that enable extraction of objects from captured network traffic.
2.1. The Passive Adversary and Threat Model
Our work assumes a passive Dolev-Yao adversary [4] that observes all network communication between honest agents. In the man-in-the-middle configuration we consider, messages sent by one honest agent are received by the intruder and forwarded, unmodified, to their intended recipient. Figure 1 illustrates this communication pattern. In the active model, the intruder may also modify, drop or inject messages; in the passive model, the intruder's capabilities are restricted to observation and transparent forwarding.
The passive adversary model captures the threat posed by bulk surveillance operations that record network traffic for later analysis: the adversary can observe all messages in transit, store them, and later analyse them when cryptographic keys become available.

Figure 1: Passive Dolev-Yao adversary model: all communication is mediated by the intruder, who observes and transparently forwards messages.
Formally, the passive intruder has the same deductive capability as the active intruder but is restricted in its actions: it observes messages and may derive new terms from its knowledge, but it cannot construct and transmit arbitrary messages of its own choosing. The intruder's knowledge evolves as follows:
-
Initially, contains all public information: agent identities, public keys, and protocol-specific public constants.
-
Upon observing a message on the network, the intruder adds to its knowledge: .
-
The intruder can apply the standard Dolev-Yao deduction rules (Figure 2) to derive new terms from its knowledge.
This deductive capability is crucial for our reconstruction: the intruder must parse observed messages, verify their well-formedness, and validate that they are consistent with the protocol specification.
Compiled checks and Dolev-Yao deduction. The reconstruction stage evaluates the consequences of the compiler's Dolev-Yao analysis rather than performing symbolic deduction at run time. The AnBx compiler analyses the protocol under the Dolev-Yao deduction rules at compile time and materialises the consequences of that analysis as receive-side checks in the generated intruder role. The checks are derived from the compiler's analysis [12, 13] of the specification, not from the implementation, and express the constraints the analysis places on received messages; the analysis has been validated empirically on a broad test suite of security protocols [12]. The compiled intruder therefore mirrors a Dolev-Yao intruder whose deduction has been performed in advance: the checks are the same ones the compiler would have generated for a network execution,
Figure 2: Dolev-Yao intruder deduction rules. The last rule applies only to public function symbols; private functions (declared with ->*) cannot be constructed by the intruder from known arguments.
and their outcomes depend only on the recovered messages and the specification, not on whether those messages arrived over a socket or were read from a file.
The adversary is assumed to have knowledge of the protocol specification (in the AnBx language), the public keys of all honest agents, the network configuration (addresses and ports), the mapping from observed IP addresses and ports to protocol roles, the channel structure, and the agent-role mapping. It is also assumed to know the wire format used by the protocol implementation (here, Java serialisation over TCP). Decryption is only possible if cryptographic keys are public or become available through compromise or cryptanalysis. From a surveillance perspective, this information corresponds to what may be obtained from protocol documentation, network metadata, prior observation, or other intelligence sources. The contribution is not that a passive adversary can infer all of this from an arbitrary PCAP; it is that, once this knowledge is available, the semantic reconstruction itself can be automated. The extraction stage does not depend on the compiler having produced the implementation, and the defensive checks are derived from the specification, not from the implementation; both claims are substantiated in Sections 4.6.1 and 4.6.2.
We assume all communication follows the standard Dolev-Yao pattern , where the intruder intr simply forwards messages without modification. Complete observation of all messages is assumed; if messages are lost or reordered, the reconstruction may not correspond to a valid protocol execution.
This passive adversary model defines the threat landscape addressed by our reconstruction framework: instantiated the passive Dolev-Yao intruder operationally means reconstructing its observed protocol execution from the PCAP and evaluating the specification-derived checks against the recovered messages. The following subsection describes the AnBx specification language, which provides the protocol models used throughout the paper.
2.2. Protocol Specification with AnBx
The AnBx language [12] extends the Alice & Bob notation (AnB [17]) with channel abstractions that allow protocol designers to specify security properties independently of their concrete cryptographic realisation. While these abstractions are useful for high-level protocol design, our reconstruction pipeline operates on the concrete compiled form of the specification, after channel abstractions have been resolved. This is because the captured PCAP traffic contains real-world messages, not abstract channels. We therefore present the language in its concrete AnB form, which is the input to the compiler stages that generate executable code.
A protocol specification consists of four mandatory sections:
Types Declares agent roles, function symbols, and type signatures. Functions may be declared private (denoted by ), meaning the intruder cannot construct the function's output even if it knows the arguments.
Knowledge Defines the initial knowledge of each agent. Agents may also share terms (e.g., pre-shared symmetric keys) or agree on values prior to protocol execution.
Actions Describes the protocol's message exchanges in an ideal execution.
Goals Declares the security properties to be verified (secrecy, authentication, weak authentication).
The Actions section defines the expected sequence of messages, their ordering, and the channels over which they are transmitted. This information is used by the compiler to generate the channel-to-step mapping that guides the reconstruction process described in Section 3.
Figure 3 illustrates a complete specification of the Carlsen protocol [18], a classic authenticated key exchange protocol that relies on a trusted server .
The protocol involves three agents: two principals and who wish to establish a fresh symmetric key , and a server that assists in the key distribution. The private function , declared with the annotation, allows to model a pre-shared symmetric key between each agent and the server ( and ). The protocol proceeds in five steps: initiates with a nonce sent to ; generates another nonce and forwards them to the server; the server responds with two encrypted messages containing the new key and the nonces; forwards the relevant part to ; and finally acknowledges receipt using the new key.
The security goals declared in the specification are not directly translated into defensive checks. Instead, the compiler derives the checks from the protocol's type system and knowledge sets. These checks are necessary, but not sufficient, consistency conditions: a captured trace that fails a check is not a valid execution of the protocol, but passing every check does not by itself establish that the protocol achieves its declared security goals. The AnBx compiler translates specifications such as the one in Figure 3 into executable Java code through a multi-stage pipeline, which we describe in the following subsection.
Protocol: Carlsen AnB
Types: Agent A,B,s; Number NxNA,NxNB,NxNB2; SymmetricKey KxKAB; Function [Agent,Agent ->* SymmetricKey] shk
Knowledge: A: A,B,s; B: B,A,s; s: A,B,s; A,s share shk(A,s); B,s share shk(B,s)
Actions: A -> B: A,NxNA B -> s: A,NxNA,B,NxNB s -> B: { | KxKAB ,NxNB ,A | } shk(B,s), { | NxNA,B,KxKAB | } shk(A,s) B -> A: { | NxNA,B,KxKAB | } shk(A,s), { | NxNA | } KxKAB,NxNB2 A -> B: { | NxNB2 | } KxKAB
Goals: B authenticates s on KxKAB,A A authenticates s on KxKAB,B KxKAB secret between A,B,s
Figure 3: Carlsen protocol specification in AnB (concrete form)
2.3. The AnBx Compiler
The AnBx compiler [13] translates high-level protocol specifications into executable Java code through a pipeline consisting of multiple steps. Our passive intruder reconstruction extends the pipeline with mechanisms for generating intruder code and validating reconstructed serialised objects.
2.3.1. Compilation Stages
The compilation consists of three main phases:
-
AnBx to AnB Translation: The abstract channel modes in the AnBx specification are compiled to concrete cryptographic constructions in the AnB language.
-
TypedExecNarr Generation: The AnB protocol is translated to a typed executable narration (TypedExecNarr), an intermediate representation that captures the operational semantics of the protocol. The TypedExecNarr includes defensive checks derived from the protocol's knowledge and type system, namely well-formedness, equality, inversion and seen checks.
-
Java Code Generation: The TypedExecNarr is translated to Java code using template-based generation. The generated code uses the AnBxJ security library [13] for cryptographic and communication operations.
The defensive checks generated by the compiler are crucial for validating incoming messages for honest agents, and captured traffic for the intruder:
- Well-formedness checks ensure that each received term has the expected type (e.g., a number in a numeric position, a symmetric key where a key is expected).
- Equality checks verify that terms are equal as expected by the protocol (e.g., the nonce received from A matches the nonce sent by A).
- Inversion checks verify that encrypted or signed messages can be correctly decrypted or verified using the appropriate keys.
- Seen checks record the sequence numbers received so far and reject any that have been observed before, detecting replay when sequence numbers are used to implement freshness.
These checks instantiate the Dolev-Yao deduction rules presented in Section 2.1 on concrete messages, with well-formedness checks imposing a stricter typing discipline than the type-free term construction of the standard model. They form the basis of the validation performed by the passive intruder.
2.3.2. Passive Intruder Generation
Two compilation modes support the reconstruction workflow. The first, invoked with -out:JavaDocker -jdockerpcap, generates code for protocol execution under a passive man-in-the-middle configuration within a Dockerised environment, producing a PCAP file that captures all protocol messages. The second, invoked with -out:Java -objcheck, generates the intruder code that reconstructs the captured trace from extracted object files for each step. The reconstruction pipeline uses the first mode to capture traffic and the second to reconstruct and validate it; we describe both modes in detail in Section 3.
The compiler also supports -out:AnBxIntr, which injects an explicit intruder agent between every pair of communicating agents at the TypedExecNarr level (Section 3.8.1). This transformation is applied internally by the reconstruction mode (-out:Java -objcheck), which analyses the intruder-injected narration to derive the receive actions the intruder must perform and the defensive checks associated with them. The capture mode (-out:JavaDocker -jdockerpcap) does not rely on this transformation; the intruder is placed between the honest agents by the Docker network topology, described in Section 3.8.
2.4. Java Serialisation
Our reconstruction pipeline relies on the ability to extract serialised Java objects from captured network traffic. Java serialisation is a mechanism for converting Java objects into a byte stream that can be transmitted over a network or persisted to disk [19]; while the format is widely deployed, deserialising untrusted input has been the source of numerous remote-code-execution vulnerabilities [20]. A serialised stream begins with a four-byte header consisting of the magic number AC ED and the protocol version 00 05. The header is followed by the serialised objects themselves; each object contributes a class descriptor, its field data, and, where a value has already been serialised earlier in the stream, a cross-reference to that earlier value rather than a copy of it.
A key feature of Java serialisation is the handling of object graphs. If an object contains references to other objects, the serialisation protocol preserves the graph structure using TC_REFERENCE markers (0x71). When multiple objects are written to the same stream, references from later objects can refer to earlier objects, enabling efficient serialisation of complex data structures. For our purposes, this means that a single TCP stream may contain multiple serialised objects that reference each other. Figure 4 illustrates the mechanism: the first occurrence of a shared object is written in full and assigned a handle; later occurrences are written as a TC_REFERENCE to that handle. Reading the complete stream lets Java's deserialiser resolve the handle automatically, which is why our pipeline deserialises each captured stream as a whole rather than attempting to split it into objects by scanning for magic numbers.
The ObjectInputStream class handles deserialisation automatically when used in a loop until EOFException is thrown. However, Java serialisation introduces a subtle complication: when a class overrides the writeObject method and enters block-data mode, the stream emits a TC_ENDBLOCKDATA (0x78) marker to delimit the block [19]. While these markers are correctly consumed during normal deserialisation, they interact with the way Java's reader distinguishes between object and primitive data when a captured stream is parsed offline; in the protocol implementations evaluated here, this can produce OptionalDataException during reconstruction. The pipeline must therefore handle these markers explicitly, as we describe in Section 3.
Example (multiple objects in one stream). Consider a stream carrying two serialised AnBx_Params objects, and , written by a class that overrides writeObject:
Only begins with the magic number; starts with a TC_OBJECT marker (0x73) and no magic number. A reader scanning for aced0005 alone will therefore find exactly one object per stream, regardless of how many were written, and cannot in general recover the boundary between and . A reader that consumes the stream one object at a time handles the block-data markers transparently and also maintains the reference table needed to resolve TC_REFERENCE markers such as those shown in Figure 4. Because object boundaries cannot be reliably identified from the stream alone, the reconstruction pipeline defers object extraction to the ObjCheck class, which reads each stream in a single pass and preserves the reference table (Section 3.6).

Figure 4: Java serialisation with TC_REFERENCE. The first occurrence of a shared object is written in full and assigned a handle (here H1); later occurrences are written as TC_REFERENCE H1. Reading the complete stream lets Java's deserialiser resolve H1 automatically. When each top-level object is later written to its own step file, the shared object ("Alice") is materialised in each file, so the intruder role can read step files independently.
3. Methodology
This section presents our main contribution: an automated pipeline that reconstructs passive Dolev-Yao intruder executions from captured network traffic. We describe the complete workflow from PCAP to executable Java code, focusing on the technical components that implement it: PCAP-to-object extraction, connection pairing and session grouping, candidate enumeration, channel-to-step matching, multi-candidate scoring and selection, and passive intruder code generation.
Figure 5 illustrates the reconstruction methodology. Stage 1 (JavaDocker generation) and Stage 2 (Docker execution) produce the PCAP. Stage 3 (PCAP-to-streams, jpcap2ser.py + outparse.py) extracts per-TCP-stream serialised object files together with per-stream metadata in {Protocol}_streams.json. Stage 4 (session build, sessionbuild.py) pairs streams into connections, groups them into sessions, and enumerates candidate channel assignments, writing one metadata file per candidate. Stage 5 (candidate enumeration and selection, orchestrated by run_test.py) then iterates over the candidates produced by Stage 4 in two passes: Pass A runs the generated *_ObjCheck class for every candidate and snapshots its per-step files; Pass B runs the compiler and the passive intruder role for every usable candidate, scores it, and selects the best-scoring arrangement.

Figure 5: Reconstruction pipeline from PCAP to a validated Java reconstruction.
3.1. Notation
We write for a capture (the set of directional TCP streams extracted from one PCAP), for a bidirectional connection obtained by pairing reverse streams, and for the signature of a connection: its unordered endpoint IP pair together with the server port. A protocol specification fixes a set of declared channels, whose distinct signatures determine , the number of connections per session. A connected component is a maximal set of connections linked transitively by shared endpoint IPs. We write for the number of sessions it contains and for its number of connections. A candidate arrangement assigns to each of the sessions one connection for each of the connection signatures; we write for the -th candidate arrangement, indexed from 0, and refer to it as candidate i. Each candidate arrangement yields a set of per-session, per-step files and is scored by the lexicographic tuple described in Section 3.7.
3.2. Reconstruction Correctness
The evaluation in Section 4 uses the terms complete reconstruction and DY-consistent reconstruction. We define both precisely here.
Definition 1 (Complete reconstruction). A candidate arrangement is complete for a capture if every expected protocol step has exactly one recovered object associated with it.
Definition 2 (DY-consistent reconstruction). A candidate arrangement is DY-consistent if every compiler-generated passive-intruder check executed on the recovered objects passes.
Definition 3 (Successful reconstruction). A capture is successfully reconstructed if the selected candidate arrangement is both complete and DY-consistent.
Definitions 1–3 are consistency conditions on the captured trace, not a proof of security. A trace that satisfies them is consistent with the specification's type system, equality constraints, and freshness requirements; a trace that fails one of them is not a valid execution of the protocol under the specification.
3.3. Extraction of Serialised Objects
The extraction stage processes a PCAP file to produce serialised Java objects. It is implemented by two Python scripts: jpcap2ser.py orchestrates the extraction, while outparse.py performs the parsing and emits metadata.
The jpcap2ser.py script invokes TShark [11] to extract TCP stream data:
tshark -r input.pcap -Y "tcp.payload" -2 -T fields \
-e tcp.stream -e ip.addr -e data \
-e ip.src -e ip.dst -e tcp.srcport -e tcp.dstport \
-e frame.time_epoch
The -Y "tcp.payload" filter selects packets that carry application-layer data, and the -e data flag extracts that application-layer payload itself. The -2 flag enables two-pass analysis, which the pipeline uses to ensure TCP segments are reassembled consistently before the data field is extracted. This command extracts:
-
the TCP stream index (tcp.stream), which groups packets belonging to the same TCP connection;
-
the IP addresses involved (ip.addr), used to identify the communicating agents;
-
the raw application data (data), which contains the serialised Java objects;
-
the per-packet source and destination IPs and ports (ip.src, ip.dst, tcp.srcport, tcp.dstport), used to pair bidirectional streams into connections and to compute channel signatures (Section 3.4);
-
the packet timestamp (frame.time_epoch), used for tie-breaking during connection pairing and as a per-stream start/end timestamp.
We extract the data field rather than tcp.payload because data is populated by Wireshark's fallback dissector for payloads that no other dissector recognises. It therefore yields the raw application-layer bytes without any upper-layer protocol headers that a dissector might otherwise consume. Extracting tcp.payload directly can include such headers when the beginning of the payload happens to be recognised as another protocol, which interferes with object detection.
The outparse.py script processes the TShark output, grouping packets by TCP stream index and saving each complete directional TCP stream as a STREAM_X_Y.ser file, where X is the one-based TCP stream number (TShark reports tcp.stream as zero-based, so tcp.stream=0 becomes STREAM_1_Y.ser) and Y is the direction within the stream. The pipeline always invokes outparse.py with -allstreams, so every directional stream in the PCAP is saved. As a heuristic, outparse.py also checks whether the application-layer payload of each packet begins with the Java serialisation magic number (aced0005); this is used only to characterise each stream, not to delimit objects within it.
When invoked with --emit-meta, outparse.py additionally emits {Protocol}_streams.json, one record per directional TCP stream, containing the stream filename, the TCP stream index, the source and destination IPs and ports, the first and last observed timestamps, and the number of packets whose application-layer payload begins with a Java serialisation magic number. This metadata is the input to the session build stage.
A key challenge in this stage is that a single directional stream may contain multiple serialised objects. When more than one object is written to the same ObjectOutputStream, only the first begins with the magic number, and no explicit markers separate the objects thereafter. Rather than attempting to delimit objects at the byte level, outparse.py saves each stream in full and defers object extraction to the ObjCheck class, which reads the stream once and preserves the Java serialisation reference table (see Section 3.6).
Example. For the Carlsen capture at , each session contributes four directional streams, eight in total. In each session, the direction of the connection carries two objects (steps 1 and 5); the other three streams of the session carry one object each. This multi-object stream is the case that motivates deferring object extraction to ObjCheck: the second object does not begin with the magic number and cannot be delimited by scanning alone.
3.4. Connection Pairing and Session Grouping
Stage 4, implemented by sessionbuild.py, consumes {Protocol}_streams.json together with the protocol's .properties file and groups the observed streams of the capture into protocol sessions. The .properties file is the concrete representation of the deployment metadata introduced in Section 2.1: it records the mapping from IP addresses and ports to protocol roles, the channel structure, and the expected channel order. In our implementation it is generated by the AnBx compiler, but its content is deployment-specific rather than compiler-specific, and the same information would be available to an analyst from network metadata, protocol documentation, or prior observation. From these definitions sessionbuild.py computes , the number of distinct connection signatures that constitute one protocol session. A connection signature is the unordered pair of endpoint IPs together with the server port; channels that share the same signature are counted once, so is not in general equal to the number of declared channels. is therefore a per-session quantity: a capture containing sessions comprises connections in total.
Connection pairing. Directional TCP streams are first paired into connections. Each stream has an oriented endpoint tuple (, , , ); a connection is keyed by the unordered pair of its endpoints, so the two directional streams that make up a bidirectional connection share a key even though their tuples are exact reverses of each other. If more than one reverse candidate exists, the peer whose per-stream timestamp is closest to the stream's is selected. The resulting connection records its two directional stream files, its endpoints, its signature , and its start and end timestamps, denoted and . The connection's is the smaller of its two streams' values. The direction of the stream whose is smaller is labelled ; the reverse direction is .
Session grouping. Before grouping, connections whose signature does not match any declared channel are discarded. This filters out traffic that happens to share endpoints with the protocol but is not part of it, such as the Docker network handshake, health checks, or unrelated background traffic.
The remaining connections are then grouped using connected components over shared agent IPs: two connections belong to the same connected component if they share at least one endpoint IP. A connected component is therefore a set of connections transitively linked through shared endpoints, not a set of agents or sessions. In the typical capture, where a fixed set of agent IPs participates in the protocol execution, this yields a single connected component containing all the connections of that execution, across all of its parallel sessions; the connected component therefore spans every agent role in the protocol, not a single agent.
For a well-formed single-session trace the connected component contains exactly connections. When the PCAP contains parallel sessions, a connected component may contain connections, all sharing the same agent identities and using a distinct ephemeral port per session. The number of connections in a connected component relative to distinguishes three cases:
-
: the connected component is a single session. It is emitted directly, tagged with confidence level high.
-
: the connected component contains interleaved sessions. It is split by enumerating candidate arrangements, as described in Section 3.5. The resulting sessions are tagged with confidence level medium and a reason such as signature-split ( arrangements).
-
: the connected component contains fewer connections than a single session requires. A warning is emitted; in -strict mode the protocol is aborted.
The grouping is deliberately conservative: the time-based t_start ordering (the connection-level timestamp defined above) is not trusted as a correctness criterion. It is used only as a tie-breaker when pairing reverse streams, and to sort connections within each signature before candidate enumeration. The final choice of arrangement is made later, by scoring the candidate reconstructions (Section 3.7).
Example. Figure 6 shows the shape of a typical connected component for the Carlsen protocol at . Carlsen declares two connection signatures (), the A↔B and B↔s connections, so the component contains connections, all transitively linked through B. The pipeline must recover which A↔B connection belongs to which B↔s session; this is the step that candidate enumeration and scoring perform.

Figure 6: The Carlsen connected component at . The colour grouping is candidate 0, the identity arrangement; the pipeline also evaluates permutations of this assignment (Section 3.7).
3.5. Candidate Enumeration and Channel Assignment
A connected component that contains exactly connections is a single session and is emitted directly (Section 3.4). When it contains more connections than that, the pipeline must decide how they divide into sessions. Let be the number of connections in the component. Since each session contributes one connection per signature, the number of sessions is , where is the number of connection signatures per session. A component whose size is not a multiple of is discarded with a warning, since the capture is then inconsistent with the protocol's declared channel structure.
The pipeline groups the connections by signature, so that each of the signatures holds exactly connections, and sorts the connections within each signature by t_start.
For there is a single arrangement, since and there is nothing to permute: with only one signature, each of the sessions receives a distinct connection and the assignment is forced. For , one signature is fixed as the reference. Its connections, already sorted by t_start, are numbered 1 to , and connection in this ordering defines session . The remaining signatures are then assigned to sessions by permutation: for each such signature, any of the bijections from its connections to the sessions is admissible. The total number of candidate arrangements is therefore
Each arrangement thus assigns, for each of the sessions, one connection for each of the signatures.
Because the candidate space grows factorially, sessionbuild.py applies a cap MAX_ARRANGEMENTS. When the raw number of arrangements is at most the cap, the full space is enumerated. Otherwise the pipeline falls back to a heuristic subset of arrangements; this path is not exercised by our evaluation. The cap is set to 120, which keeps full enumeration feasible up to for , for , and for . For the Carlsen-style protocols used in our evaluation (), this corresponds to ; the raw space for would be arrangements, which is infeasible at Stage 4. Larger requires content-based pruning and is left as future work (Section 7).
Each candidate arrangement is written to a flat TXT file {Protocol}_session_meta_ci.txt; collectively, these are the files consumed by Stage 5. Each file identifies the protocol, the input PCAP, the number of sessions, and the candidate index , and then, for every session, lists the connections that the arrangement assigns to it, one line per channel, of the form
where conn_id is the identifier of the connection, dir is its direction (ab or ba), and stream_file is the directional stream file from which the objects for that channel are to be read by the object checker.
Example. The Carlsen component of Figure 6 has and, at , two connections per signature. Denote by the A↔B connections in t_start order, and by the B↔s connections. The candidate arrangements are
The colour grouping in Figure 6 corresponds to , the identity arrangement, in which each signature's connections are paired in their t_start order. The pipeline evaluates both arrangements and selects the one with the higher score under the tuple of Section 3.7.
3.6. ObjCheck and Channel-to-Step Mapping
In our reconstruction pipeline, each protocol step corresponds to exactly one serialised Java object that is sent or received. We therefore use the terms step and object interchangeably when referring to the number of messages in a protocol execution.
A critical challenge is determining the correct protocol step for each extracted object. The order in which streams appear in the PCAP does not necessarily correspond to the protocol's step order, and a single directional stream may carry objects belonging to different steps. The ObjCheck class, generated by the AnBx compiler, resolves this mapping using the candidate-specific metadata file and the compiler-generated step-to-channel map. The compiler generates the Carlsen_Channels enum from the channel definitions in the .properties file, preserving their order. This shared ordering is what allows the compiled code (which uses the enum), the .properties file (read by the extraction stage), and the captured streams to agree on channel identifiers. For the Carlsen protocol, the ObjCheck step-to-channel map is:
static Map<Carlsen_Steps, Carlsen_Channels> channelStepMap = new HashMap<>();
static {
channelStepMap.put(Carlsen_Steps.STEP_1, Carlsen_Channels.ROLE_B_channel_ROLE_A_Server_Insecure);
channelStepMap.put(Carlsen_Steps.STEP_2, Carlsen_Channels.ROLE_s_channel_ROLE_B_Server_Insecure);
channelStepMap.put(Carlsen_Steps.STEP_3, Carlsen_Channels.ROLE_B_channel_ROLE_s_Client_Insecure);
channelStepMap.put(Carlsen_Steps.STEP_4, Carlsen_Channels.ROLE_A_channel_ROLE_B_Client_Insecure);
channelStepMap.put(Carlsen_Steps.STEP_5, Carlsen_Channels.ROLE_B_channel_ROLE_A_Server_Insecure);
}
ObjCheck also constructs the inverse map channelStepMapInverse(), which associates each channel with the ordered list of protocol steps expected on that channel. For each channel entry in the candidate's metadata file, ObjCheck opens the corresponding stream file with a single ObjectInputStream and assigns the deserialised objects to consecutive steps for that channel, in ascending step order as recorded by the inverse map. If the number of objects and the number of expected steps differ, a mismatch is reported and the assignment is truncated to the minimum of the two. The missing steps are later reflected in the candidate's score (Section 3.7). The result is a set of per-session, per-step files {Protocol}_<session>_STEP_<n>.ser. These are the files consumed by the generated passive intruder role. Multi-object streams are handled in the same pass, since the inverse map records the ordered list of steps expected on each channel.
Block-data handling. A further challenge is Java serialisation's TC_ENDBLOCKDATA markers (0x78), which delimit custom writeObject() implementations (Section 2.4). In the protocol implementations evaluated here, custom serialisation and block-data mode can produce OptionalDataException during offline extraction when object boundaries are reconstructed from captured streams. The readObjectsFromFile method in ObjCheck handles OptionalDataException by skipping the indicated number of bytes. In principle, one could parse the serialised stream manually and adjust the TC_REFERENCE markers to point to the correct objects; however, this would require low-level byte-level parsing and a global analysis of the object graph across the entire captured traffic, as references are relative to the position of objects within the stream (see Figure 4). Our approach avoids this complexity by leveraging Java's built-in deserialisation mechanism on complete streams, which automatically resolves references without manual intervention.
When each object is later saved as a separate {Protocol}_<session>STEP<n>.ser file, references between objects are not preserved across step files. This is acceptable because the intruder role reads each step file independently and does not rely on object identity being preserved across step files. For parallel sessions, the situation is even simpler: each session uses a distinct TCP connection and therefore a distinct stream file, so objects from different sessions never shared a reference table in the first place.
Separation of ObjCheck from code generation. One implementation detail is important for the orchestration. When the compiler is invoked with -out:Java -objcheck, it may overwrite files such as *_Channels.java. Running a later ObjCheck after that would therefore be unsafe. The pipeline consequently separates all object checks from all Java generation and execution; the two passes are described in the following subsection.
Example. For the Carlsen session in Figure 6, the inverse map associates the A↔B channel with the ordered pair [STEP_1, STEP_5], and each of the other three channels with a single step. The candidate metadata in turn specifies one stream file per channel. Applying the two tables together, ObjCheck opens each stream file once and writes the objects it reads to the corresponding step files: the A↔B stream yields two step files (STEP_1 and STEP_5), and each of the other three streams yields one. The result is five step files per session, one for each protocol step.
3.7. Multi-Candidate Scoring and Selection
Candidate selection is orchestrated by run_test.py in two passes over the candidate arrangements produced by sessionbuild.py.
Pass A: ObjCheck per candidate. For each candidate index i, the pipeline copies {Protocol}_session_meta_ci.txt to the working path {Protocol}session_meta.txt, removes any existing {Protocol}STEP.ser files, and runs ant objcheck, which produces the per-step .ser files for that candidate. If the candidate TXT is missing, or if ObjCheck produces no STEP files, the candidate is recorded with a sentinel score (-1,0,0) and skipped. Otherwise, the produced STEP files are copied to a snapshot directory {Protocol}_step_snapshots/ci/. The snapshot is essential: it preserves each candidate's object assignment independently of later compiler invocations that would otherwise overwrite *_Channels.java.
Pass B: Java generation and passive intruder per candidate. For each candidate that survived Pass A, the pipeline restores the snapshot, copies the candidate TXT back to the working path, and then iterates over the sessions. For each session it runs
anbxc <Proto>.AnBx -out:Java -objcheck -nocfgmsg -silent
-securityProvider <BC|default> -objchecksession <sid>
where BC selects the Bouncy Castle provider and default selects the standard JDK provider, followed by
ant -buildfile <src>/build.xml runagents
The captured standard output and standard error are retained for scoring.
Scoring. The passive intruder emits check results using the markers CHECK # <id> and check FAILED!. These markers are emitted by the check functions in the AnBxJ library and parsed by the orchestrator; they form a light-weight internal interface between the generated code and the scoring logic, and can be replaced with a structured report if the toolchain is extended. For each candidate, the pipeline counts, per session, the total number of checks and the number of failed checks. A session with no recorded checks is penalised more heavily than one with failing checks: it decrements the clean-session count rather than merely failing to increment it. The candidate score is the lexicographic tuple
(n_clean_sessions, -total_failed_checks, total_checks),
where n_clean_sessions is the number of sessions that ran at least one check and failed none, minus the number of sessions that ran no check at all. Higher tuples are better. The selected candidate is the one with the maximum score; ties are broken by the lowest candidate index.
Object recovery enters the score indirectly. A missing object means the checks that would have been exercised on it are not counted, which lowers total_checks; if it leaves a session with no checks at all, n_clean_sessions is decremented. A candidate that recovers fewer objects therefore scores lower, all else being equal. The score function captures the intuition that a correct arrangement should reconstruct every session and pass every defensive check: the negative total-failed term penalises incorrect pairings, and the total-checks term rewards arrangements that produce more reconstruction evidence.
Scoring is performed for every candidate, not only the winner, so that the alternatives can be compared on the same capture. The procedure selects the correct arrangement whenever it is among the enumerated candidates and is the unique maximiser of the score tuple; it does not guarantee correctness when the correct candidate is absent or when ties occur, in which case the lowest-index candidate is selected.
Winner selection. After selection, the pipeline logs the winner's channel assignment (one line per channel per session), overrides the aggregate return codes with the winner's per-stage return codes, and copies the winning candidate TXT to the final {Protocol}_session_meta.txt. This ensures that the CSV row and the logged reconstruction summary describe the candidate that was actually shipped, rather than the last candidate visited.
The multi-candidate approach is what makes the pipeline robust to the failures of the time-based heuristic used during pairing. The t_first timestamps of the per-session connections can differ by only a few microseconds, so the identity arrangement (which places each signature's connections in the order of their t_start timestamps) is not guaranteed to be the correct one, and the winning candidate is not fixed across session counts of the same protocol. The scoring loop is therefore not an optimisation on top of the heuristic but the mechanism that allows the reconstruction to correct the heuristic whenever the correct arrangement is among the enumerated candidates. What the score table contributes is not a fixed index but the identification, for each individual reconstruction, of the best-scoring arrangement under the scoring tuple defined above.
Example. For the Carlsen component of Figure 6 at , candidate 0 (the identity arrangement) scores and candidate 1 scores . Both candidates execute the same 26 checks, but candidate 1 leaves both sessions clean whereas candidate 0 leaves two failed checks; since the comparison is lexicographic, candidate 1 is selected. This is the arrangement of the enumeration example in Section 3.5.
3.8. Intruder Code Generation
Pass B of Stage 5 invokes the compiler for every candidate and executes the generated passive intruder role on the candidate's step files; the checks the role performs feed the scoring. This subsection explains how the compiler transforms the protocol specification into that role, the ROLE_intr class.
3.8.1. Intruder Injection
The compiler provides a transformation, selected by -out:AnBxIntr, that injects an intruder agent between every pair of communicating agents at the TypedExecNarr level. The reconstruction mode (objcheck) applies this transformation internally as an intermediate step, so the transformed narration is what the compiler analyses when generating the passive intruder role's checks; the capture mode relies instead on the Docker network topology, not on this transformation. Each send action in the original protocol is split into two actions:
-
A:send(intr,M) — the original sender sends to the intruder;
-
intr:send(B,M) — the intruder forwards to the intended recipient.
Crucially, the intruder is treated as just another agent role in the transformed protocol. The compiler's defensive check generation applies uniformly to every agent: for each receive() action, it generates well-formedness checks
(wff), equality checks (eq), inversion checks (inv) and seen checks on sequence numbers, based on the types of the received terms, the expected values, and the cryptographic operations required. Thus, the intruder automatically receives the defensive checks derived by the compiler from the specification, matching honest agents' behaviour.
For the Carlsen protocol, the original action:
1 | A: send(B;<A,NxNA>) 1 | B: VAR_B_R1 := receive() 1.1 | B: wff(proj [2/2] [VAR_B_R1]) 1.2 | B: eq(A,proj [1/2] [VAR_B_R1])
becomes:
1 | A: send(intr;<A,NxNA>) 1 | intr: VAR_INTR_R1 := receive() 1.1 | intr: wff(proj [2/2] [VAR_INTR_R1]) 1.2 | intr: eq(A,proj [1/2] [VAR_INTR_R1]) 2 | intr: send(B;<A,proj [2/2] [VAR_INTR_R1])> 2 | B: VAR_B_R2 := receive() 2.1 | B: wff(proj [2/2] [VAR_B_R2]) 2.2 | B: eq(A,proj [1/2] [VAR_B_R2])
The intruder's checks at steps 1.1 and 1.2 are generated automatically by the compiler's standard check derivation mechanism, not by copying from the honest agent's checks at steps 2.1 and 2.2. Both sets of checks are derived from the same underlying protocol model and type information, ensuring consistency across all agents.
Correspondence with Dolev-Yao analysis. The check at step 1.2 is the compiled form of a constraint derived from the Dolev-Yao analysis of the specification. The projection proj [1/2] [VAR_INTR_R1] extracts the first component of the observed tuple, matching the Dolev-Yao projection rule on the received message. The equality check on the extracted value records the constraint the specification places on this component: it must carry the identity of agent A. Each check the compiler generates corresponds to one such constraint, and the check's outcome records whether the recovered observation satisfies it. This is the sense in which the compiled intruder mirrors a Dolev-Yao intruder whose deduction has been performed in advance: the deduction rules (projection, decryption) are evaluated on the recovered message, and the check functions record the constraints under which the deduced values are consistent with the specification.
3.8.2. Capture and Reconstruction Modes
The capture mode, invoked with -out:JavaDocker -jdockerpcap, generates Java code that executes the protocol within Docker containers. The Docker network is arranged as a star whose centre is the DY container, through which all traffic between the honest agents passes; this container runs a packet capture and records the traffic to a PCAP file. The reconstruction mode, invoked with -out:Java -objcheck, generates the ROLE_intr class, which reads {Protocol}_<session>STEP<n>.ser files and reconstructs the captured trace offline.
When generating code with -objcheck, the compiler applies a further transformation to the intruder-injected TypedExecNarr. First, all send() actions are removed. Second, only the intruder's receive actions are retained. In the transformed narration these fall on odd-numbered positions (step 1: ; step 3: ; step 5: ; and so on), because each original send becomes a pair of actions (sender-to-intruder, then intruder-to-recipient) and the intruder's receive is the first of the pair. Third, the retained steps are renumbered consecutively: odd steps become , preserving the order of observation.
For the Carlsen protocol, the original intruder receive steps (1,3,5,7,9) become STEP_1 through STEP_5 in the generated code. When the reconstruction is run across parallel sessions, the compiler is invoked once per session with -objchecksession <sid>, and the generated ROLE_intr processes the corresponding session's step files in the working directory.
The compiler also determines the expected type of each step's payload by analysing the expression in the corresponding send() action. If the expression is a signed message (NESign), the step expects a Crypto_SignedObject; if it is encrypted (NEEnc or NEEncS), the step expects a Crypto_SealedObject; otherwise, it expects an AnBx_Params (a tuple of values). This type information is used in the generated executeStep method to cast deserialised objects correctly, as shown in the code listing below:
case STEP_1: AnBx_Params VAR_STEP_1 = (AnBx_Params) AnB_Session.readObject(filename); break; case STEP_5: Crypto_SealedObject VAR_STEP_5 = (Crypto_SealedObject) AnB_Session.readObject(filename); break;
3.8.3. Generated Code
The ROLE_intr class (Figure 7) reads serialised objects from the per-step files and performs the defensive checks derived by the compiler from the specification. The intruder does not send messages to the network; it merely validates the captured trace. It is important to distinguish this validation from structural deserialisation. Deserialisation ensures that the bytes are well-formed Java objects; the defensive checks verify that these objects conform to the protocol's type system, equality constraints, and freshness requirements. The latter is what determines whether a captured trace constitutes a valid protocol execution.
4. Experimental Results
To validate the practical viability of our passive intruder reconstruction methodology, we conducted an evaluation on a test suite of 121 protocols. The evaluation covers Java-serialised traffic over TCP and addresses five questions: whether the toolchain can extract serialised objects from PCAPs and map them
public final class Carlsen_ROLE_intr extends AnB_Protocol<...> {
protected void executeStep(AnB_Session s, SessionState st,
Carlsen_Steps step) {
switch (step) {
case STEP_1:
st.VAR_INTR_R1 = (AnBx_Params)
AnB_Session.readObject("Carlsen_1_STEP_1.ser");
wffCheck("1.1_WFF", st.VAR_INTR_R1.getValue(1));
eqCheck("1.2_EQ", aliases.get("ROLE_A"),
st.VAR_INTR_R1.getValue(0));
break;
// ... remaining steps
}
}
}
Figure 7: Generated intruder code in reconstruction mode (-objcheck) for the Carlsen protocol. The step-file prefix (Carlsen_1, Carlsen_2, ..., one per session) is baked into the generated source by the per-session compiler invocation with -objchecksession <sid>; this is why the pipeline regenerates the intruder role for every session inside Pass B.
to protocol steps; whether the passive intruder role validates the reconstructed traces against the protocol specification; whether the defensive checks discriminate on semantic content; whether the framework detects modifications of a valid reconstruction; and whether the pipeline is efficient enough for practical use. The first two questions are addressed in Sections 4.4 and 4.5; the last three, together with the independence of the extraction stage from the compiler, are addressed in the three additional experiments of Section 4.6. The interpretation of these results, together with the limitations of the approach, is presented in Section 5.
4.1. Experimental Setup
All experiments were performed on a machine equipped with an Intel Core i7-4700HQ CPU at 2.40 GHz with 16 GB of RAM, running Windows 11. The toolchain comprises the AnBx compiler version 2026.09 (compiled with GHC 9.10.3), TShark (Wireshark) 4.4.8 for PCAP processing, Java OpenJDK 21.0.12 and Docker Desktop 4.89 for executing the generated protocol code, Python 3.14.3 for the extraction scripts, and Apache Ant 1.10.17 for build automation.
The reconstruction pipeline was executed using the run_test.py script, which orchestrates each stage and collects timing data automatically. The single-session experiment (Section 4.4) runs each protocol with one execution of each agent role. A multi-session experiment, reported in Section 4.5, additionally runs the 112 protocols whose generated implementations support parallel sessions at and parallel sessions, where is the number of parallel protocol sessions; the remaining 9 protocols are reconstructed as single-session captures. PCAPs were generated by executing the protocols with the passive intruder variant of the generated Java code (-out:JavaDocker -jdockerpcap). For each protocol, run_test.py orchestrates the full pipeline (Stages 1–5 of
Figure 5), from generating the Dockerised Java code and capturing the PCAP to building sessions, running ObjCheck per candidate, and finally executing the passive intruder to score and select the winning arrangement. Timing data is recorded for each stage and appended to a single CSV file with one row per run.
Generative AI tools were used during development to debug the Python scripts implementing the reconstruction pipeline and the analysis scripts used to aggregate the reported results, and to make minor code adaptations in those scripts. All such output was reviewed and tested against the pipeline's recorded outputs; the author verified the final versions of all scripts and takes full responsibility for the correctness of the code and of the results reported in this paper.
4.2. Test Suite
The test suite comprises 121 protocols drawn from the standard AnBx distribution, including a range of industrial payment protocols. The protocols represent a broad spectrum of security goals, including secrecy, strong authentication, and weak authentication. They also cover a range of cryptographic primitives, such as asymmetric encryption, symmetric encryption, digital signatures, hash functions and HMAC, and Diffie-Hellman key agreement. The test suite includes several well-known protocols from the literature: the Needham-Schroeder Public Key protocol [21], Woo-Lam [22], Carlsen [18], Andrew Secure RPC [23], TMN [24], ISO symmetric key protocols [25], Diffie-Hellman authenticated variants [12], and protocols from the SET [15] and iKP [16] families.
For all experiments, the following cryptographic configuration was used: asymmetric encryption and signatures employed RSA with 2048-bit keys, using the transformation RSA/ECB/0AEPWithSHA-256AndMGF1Padding and signature algorithm SHA256withRSA; symmetric encryption used AES with 256-bit keys in GCM mode (AES/GCM/NoPadding); key agreement used Diffie-Hellman with a 4096-bit modulus; hash functions used SHA-256; and HMAC used HMACSHA256 with 512-bit keys. The protocol code was generated using this configuration for both the standard JDK 21 cryptographic provider and the Bouncy Castle provider (version 1.85.2), allowing us to compare the impact of the security provider on reconstruction success.
4.3. Metrics
We consider two types of metrics: reconstruction accuracy and runtime efficiency. Reconstruction accuracy captures how faithfully the pipeline recovers objects and passes defensive checks, while runtime efficiency captures the cost of each stage of the pipeline.
Reconstruction accuracy. For each protocol we record the number of expected serialised objects (corresponding to the protocol steps) and the number successfully recovered by the pipeline. We also record the number of defensive checks executed by the generated intruder and the number that pass. Four check types are reported, all derived from the protocol specification: well-formedness (wff), equality (eq), inversion (inv) and seen (seen) checks. These checks validate that the reconstructed objects match the expected types, values and freshness requirements defined in the specification. They do not imply that the protocol is secure or vulnerable; they confirm that the captured trace is consistent with the protocol's expectations.
From these per-protocol measurements we derive four aggregate indicators, reported in the results tables: ObjCheck completion is the fraction of runs for which the object checker produced at least one step file; complete reconstruction is the fraction of protocols for which every expected step file was produced (Definition 1); DY-consistent reconstruction is the fraction of protocols that ran the intruder role without any failed check (Definition 2); and successful reconstruction is the fraction of protocols satisfying both conditions (Definition 3). Percentages of recovered objects and of passed checks are reported alongside the absolute counts.
The reconstruction accuracy metrics are extracted automatically from the log files using the parse_logs.py script.
Runtime efficiency. We measure the wall-clock time of each stage of the reconstruction pipeline using the run_test.py script, which records timings with Python's high-resolution time.perf_counter(). The measured stages are: JavaDocker generation (anbxc -out:JavaDocker -jdockerpcap), Docker execution (protocol capture), PCAP to streams (TShark + jpcap2ser.py), session build (sessionbuild.py), stream matching (ObjCheck), Java code generation (anbxc -out:Java -objcheck), and Java execution (reconstruction and validation). The script additionally measures the actual protocol execution time by inspecting the first and last timestamps in the PCAP, providing a runtime measurement of the protocol itself that is independent of Docker orchestration. Timing data is collected in a single CSV file with one row per protocol per run, enabling analysis across the test suite.
4.4. Single Session Reconstruction
We evaluated the reconstruction pipeline using both the standard JDK cryptographic provider and the Bouncy Castle provider. Table 1 summarises the results for each provider.
The reconstruction pipeline achieved higher object recovery (97.8% vs. 97.0%), higher successful reconstruction (94.2% vs. 92.6%), and equal DY check accuracy (99.8% vs. 99.8%) when run with the standard JDK provider compared to Bouncy Castle. Successful reconstruction is defined as complete object recovery together with a clean passive-intruder execution (Definition 3). ObjCheck completion and DY-consistency were identical across both providers (100.0% and 98.3%, respectively), so the difference in successful reconstruction is driven entirely by the object-recovery stage.
The check-pass figures are conditional on the checks being executed: because checks run only on recovered objects, missing objects reduce the denominator of the pass rate as well as the numerator. The object recovery figures are therefore the primary accuracy measure, and the check-pass figures should be read as the
| Metric | Standard JDK | Bouncy Castle |
|---|---|---|
| ObjCheck completion | 100.0% (121/121) | 100.0% (121/121) |
| Complete reconstruction | 94.2% (114/121) | 92.6% (112/121) |
| DY-consistent | 98.3% (119/121) | 98.3% (119/121) |
| Successful reconstruction | 94.2% (114/121) | 92.6% (112/121) |
| Protocols with missing objects | 7 | 9 |
| Protocols with failed checks | 2 | 2 |
| Expected steps (objects) | 461 | 461 |
| Object coverage | 97.8% (451/461) | 97.0% (447/461) |
| Objects missing | 10 (2.2%) | 14 (3.0%) |
| Total consistency checks performed | 948 | 922 |
| DY check accuracy | 99.8% (946/948) | 99.8% (920/922) |
| Checks failed | 2 (0.2%) | 2 (0.2%) |
| Equality checks | 410 | 398 |
| Well-formedness checks | 528 | 514 |
| Inversion checks | 0 | 0 |
| Seen checks | 10 | 10 |
Table 1: Reconstruction outcomes with the Standard JDK and Bouncy Castle providers (121 protocols, ). Complete, DY-consistent, and successful reconstructions correspond to Definitions 1, 2, and 3. At the complete and successful fractions coincide because no protocol in this suite recovers every object while failing a check; the two diverge at (Section 4.5).
conditional accuracy of the checks given that they ran at all. This also explains why the total number of checks differs between the two providers in Table 1: the provider that recovers fewer objects also executes fewer checks.
One protocol, the Needham-Schroeder-Lowe (NSL) protocol, failed with the standard JDK provider due to a serialisation artefact, whereas it succeeded with Bouncy Castle. Specifically, with the standard JDK provider we observed an additional byte 0x67 in the extracted stream; further packet-level analysis is required to establish its precise origin. With Bouncy Castle, the serialised object length differs, the additional byte falls outside the extraction window, and the stream remains clean. The TLS protocol failed under both providers, and the IKEv2DS protocol failed only under Bouncy Castle; both are discussed further below.
No inversion checks were required for this test suite because the protocol compiler implements inversion as part of the well-formedness checks for encrypted messages. The check types reported are those explicitly labelled in the logs by the generated code.
The difference in missing objects between the two providers reveals a consistent pattern. Six protocols failed to recover all objects under both providers: DH_auth (missing 1 of 5 steps under both providers), Rev_2KP (missing 1 of 8), SET_Rev_v2 (missing 2 of 10), ShareAgree (missing 2 of 6), ShareAgree2 (missing 2 of 7), and TLS (missing 1 of 7). One additional protocol failed only under the standard JDK provider: NSL (missing 1 of 3). Three additional protocols failed only under Bouncy Castle: H530 (missing 1 of 5), H530fix (missing 2 of 5), and IKEv2DS (missing 2 of 5). Notably, the three BC-only failures all involve Diffie-Hellman key exchange, suggesting a potential serialisation issue with Bouncy Castle's handling of DH-related cryptographic objects.
The failed checks followed a parallel pattern. The TLS protocol had exactly one failed check under both providers (1 of 17 in each case), a check that could not be satisfied because the corresponding step was not recovered. The NSL protocol had one failed check under the standard JDK provider (1 of 3), consistent with its missing object. The IKEv2DS protocol had one failed check under Bouncy Castle (1 of 8), again consistent with its missing object. No other protocol had a failed check under either provider.
The cross-tabulation of object completeness and check success reveals a consistent pattern across both providers. For the standard JDK provider, 114 protocols (94.2%) had both all objects recovered and all checks passing, 5 protocols (4.1%) had missing objects but no failed checks, and 2 protocols (1.7%) had both missing objects and failed checks. For the Bouncy Castle provider, 112 protocols (92.6%) had both all objects recovered and all checks passing, 7 protocols (5.8%) had missing objects but no failed checks, and 2 protocols (1.7%) had both missing objects and failed checks. No protocol with a failed check recovered every object.
The missing objects are consistent with the block-data fragmentation described in Section 2.4. When multiple objects are written to the same stream, these markers can fragment the stream, preventing complete recovery of all objects.
The provider-specific differences observed in our experiments highlight an important practical consideration for passive intruder reconstruction: the cryptographic provider is determined by the protocol implementation being captured, not by the analyst. In real-world scenarios, the analyst have no control over which provider a target implementation uses; they must work with whatever provider is present.
Performance Results. Table 2 presents the average execution times for each stage of the pipeline, collected automatically by run_test.py. The timing data is derived from 121 protocol runs for each provider, both of which achieved 100% ObjCheck completion. Two features of the JavaDocker generation row require comment. First, the stage is bimodal: 60 of the 121 protocols generate in under 310ms, while the remaining 61 take between 1,050ms and 2,400ms. For the standard JDK provider this means the mean (726ms) lies below the median (1,050ms), unlike any other row in the table; the Bouncy Castle run does not show this pattern. Second, JavaDocker generation (Stage 1) is provider-independent: the compiler invocation carries no -securityProvider flag, and the provider is selected only at Java code generation (Stage 5). Since Stage 1 does not select a provider, the two values in that row cannot reflect a provider effect; the difference between them is run-to-run variability between the two capture campaigns.
| Stage | Operation | Standard JDK | Bouncy Castle | ||||
|---|---|---|---|---|---|---|---|
| Mean | Med. | Std | Mean | Med. | Std | ||
| 1 | JavaDocker generation | 726 | 1,050 | 489 | 1,193 | 1,133 | 194 |
| 2 | Docker execution (capture) | 41,553 | 40,512 | 2,397 | 46,128 | 45,241 | 4,125 |
| 3 | PCAP to streams | 754 | 719 | 132 | 780 | 728 | 157 |
| — | Protocol execution (from PCAP) | 733 | 477 | 710 | 881 | 661 | 843 |
| 4 | Session build | 262 | 250 | 43 | 270 | 253 | 47 |
| 5a | Stream matching (ObjCheck) | 3,557 | 3,405 | 667 | 3,667 | 3,432 | 655 |
| 5b | Java code generation | 1,693 | 1,012 | 4,867 | 1,717 | 1,007 | 4,873 |
| 5b | Java execution (validation) | 4,952 | 4,704 | 866 | 6,840 | 6,508 | 1,057 |
| Total | 54,230 | 52,030 | 7,163 | 61,476 | 59,058 | 8,359 | |
Table 2: Average execution times by pipeline stage for both cryptographic providers (121 protocol runs each, single session). All times in milliseconds. The total row reports the sum of the visible stage means. It may differ by a few milliseconds from the aggregated total recorded by run_test.py, because the displayed stage means are individually rounded.
The reconstruction pipeline completes in approximately 61.5 seconds on average with Bouncy Castle and 54.2 seconds with the standard JDK provider, both for a single-session run. The actual protocol execution time, measured directly from the communication time in the PCAP, is only 1.4% of the total in both cases (mean 881ms for BC, 733ms for JDK; medians 661ms and 477ms, respectively). This confirms that the dominant cost is container orchestration, capture setup, and the timeout used to ensure all containers terminate gracefully, rather than the reconstruction itself.
Excluding the Docker stage, the reconstruction-specific cost (the sum of JavaDocker generation, PCAP extraction, ObjCheck, Java code generation, and Java execution) is approximately 14.2 seconds for BC and 11.7 seconds for JDK, concentrated in Java execution (6.8s BC, 5.0s JDK) followed by ObjCheck (3.7s BC, 3.6s JDK); PCAP extraction, JavaDocker generation, and Java code generation each contribute under 3% of the single-session-equivalent total. The 7.2-second difference in total time between the two runs is dominated by the Docker stage (46.1s BC vs. 41.6s JDK), whose standard deviation across runs (4.1s BC, 2.4s JDK) is of the same order as the provider-to-provider difference. Since Docker orchestration is provider-independent, this difference reflects run-to-run variability in container startup and shutdown rather than a genuine performance advantage; the residual gap in the reconstruction stages is concentrated in Java execution and reflects the higher cryptographic execution cost of the Bouncy Castle provider in this configuration. The experiment establishes the observed cost difference; it does not isolate its cause.
4.5. Multi-Session Reconstruction
We evaluated the pipeline at N=1, N=2 and N=3 on the full 121-protocol suite using the standard JDK provider. The session-completion markers emitted by the generated implementations at classify 112 protocols as parallel-capable (every honest role reports Parallel/Multithreaded and SessionsCompleted
== SessionsDeclared) and 9 as sequential-only (every honest role reports Sequential, so the implementation cannot run parallel sessions even when -jparallelclients N is passed). We report the two populations separately, because only the parallel-capable subset exercises the candidate enumeration and selection machinery in Section 3.7.
Two representative excerpts from the runtime logs are shown below.
Parallel-capable (every honest role reports a parallel marker)
[ROLE_B-ALWAYS] - All sessions completed: 3/3 - Multithreaded Server [ROLE_A-ALWAYS] - All sessions completed: 3/3 - Parallel clients: 3
Sequential-only (every honest role reports a sequential marker)
[ROLE_B-ALWAYS] - All sessions completed: 3/3 - Sequential [ROLE_A-ALWAYS] - All sessions completed: 3/3 - Sequential
The classification is drawn from the honest roles only. During capture, the passive intruder is realised by the DY container, which performs packet capture but executes no protocol logic; the generated intruder role is used only during reconstruction (Section 3.8), where it reads the per-step files sequentially and does not participate in the capture.
Reconstruction success. Table 3 summarises the results. The per-object recovery rate is essentially flat across N (97.8% at N=1, 97.1–97.2% at N=2 and N=3), and the DY check accuracy is also flat (99.8%, 99.4%, 99.6%). The per-protocol success rate drops from 94.2% at N=1 to 89.3% at both N=2 and N=3. Two factors contribute. First, a protocol is counted as failed if any of its sessions misses an object, so a wider set of protocols is exposed to the serialisation artefact as the number of sessions grows: the per-object recovery rate is stable across N, but the protocol-level rate is not. Second, the cross-session freshness failures discussed below affect three additional protocols at N=2 (Orig_1KP, Orig_1KP_Fixed and Orig_2KP), all of which recover every object, and one at N=3 (Orig_1KP_Fixed). The equality of the N=2 and N=3 success rates is therefore coincidental: the two session counts fail on partially different sets of protocols.
Candidate selection is necessary. Table 4 quantifies how often the time-based heuristic used during connection pairing would have produced a lower-scoring arrangement than the winner. At N=2, 9 of the 51 K=2 protocols (17.6%) selected a candidate other than the identity arrangement; at N=3, 13 of the 51 K=2 protocols (25.5%). In most of these runs the winner passed every check while the identity arrangement did not; in a small number of iKP-family protocols the winner had strictly fewer failed checks but did not eliminate them entirely. For Orig_1KP, Orig_1KP_Fixed and Orig_2KP at N=2, and for Orig_1KP_Fixed at N=3, the residual failures are cross-session freshness checks and all objects are recovered. For Orig_2KP_Fixed at both session counts, in contrast, the residual failures follow from the missing objects described under Failure modes specific to multi-session below. The score table in Section 3.7 is therefore necessary: the time-based heuristic alone would have produced a lower-scoring arrangement in a non-trivial fraction of the K=2 protocols at both session counts.
| Metric | N=1 | N=2 | N=3 |
|---|---|---|---|
| Protocols in scope | 121 | 121 | 121 |
| Parallel-capable | 112 | 112 | 112 |
| Sequential-only | 9 | 9 | 9 |
| ObjCheck completion | 100.0% | 100.0% | 100.0% |
| Complete (all) | 94.2% | 91.7% | 90.1% |
| Complete (parallel) | - | 92.0% | 90.2% |
| DY-consistent (all) | 98.3% | 95.0% | 96.7% |
| DY-consistent (parallel) | - | 95.5% | 97.3% |
| Successful (all) | 94.2% | 89.3% | 89.3% |
| Successful (parallel) | - | 89.3% | 89.3% |
| Successful (sequential) | 88.9% | 88.9% | 88.9% |
| Expected steps (all) | 461 | 868 | 1275 |
| Objects recovered (all) | 451 (97.8%) | 844 (97.2%) | 1239 (97.2%) |
| Objects recovered (parallel) | - | 791 (97.2%) | 1186 (97.1%) |
| Total consistency checks (all) | 948 | 1745 | 2558 |
| Checks passed (all) | 946 (99.8%) | 1734 (99.4%) | 2548 (99.6%) |
| Checks passed (parallel) | - | 1617 (99.4%) | 2431 (99.6%) |
Table 3: Multi-session reconstruction success with the standard JDK provider. Rows labelled all cover the full 121-protocol suite, parallel the 112 parallel-capable protocols, and sequential the 9 sequential-only protocols. Complete, DY-consistent, and successful reconstructions correspond to Definitions 1, 2, and 3.
Failure modes specific to multi-session. Two distinct failure patterns appear at N≥2. The first is the extension of the N=1 missing-object failures: every protocol that loses objects at N=1 continues to lose them at N=2 and N=3, and a small number of additional K=2 protocols join them (Orig_2KP_Fixed, Orig_3KP_Fixed and SET_0rig_v2 at both N=2 and N=3, and Orig_2KP and Orig_3KP at N=3 only). The missing objects are of the same kind as the N=1 failures, consistent with the block-data fragmentation described in Section 2.4. The number of missing objects per protocol varies across N and does not follow a simple scaling law.
The second pattern is specific to N≥2 and does not occur at N=1. At N=2, three iKP-family protocols (Orig_1KP, Orig_1KP_Fixed and Orig_2KP) recover every expected object yet still fail some checks. The failures occur in checks that verify cross-session freshness properties: when the candidate enumeration does not pair the matching sessions across channels, the freshness check cannot be satisfied even though all messages were received. For these three protocols at N=2, no candidate arrangement passes every check, and the scoring loop selects the least-bad one. At N=3, Orig_1KP_Fixed is the only protocol that continues to show this pattern; Orig_1KP recovers every object and has at least one clean candidate, while Orig_2KP moves to the missing-object pattern described above and also has a clean candidate. The failure is therefore not attributable to concurrent execution per se, but to the inability of the current enumeration to
| Selection behaviour | N=2 | N=3 |
|---|---|---|
| Protocols with MaxCandidates > 1 | 53 | 53 |
| of which K = 2 (2 and 6 candidates) | 51 | 51 |
| of which K = 3 (4 and 36 candidates) | 2 | 2 |
| Winner ≠ candidate 0 | 9 | 13 |
| as % of K = 2 protocols | 17.6% | 25.5% |
| as % of all protocols | 7.4% | 10.7% |
Table 4: Candidate selection behaviour. At N=3, roughly one in four K=2 protocols requires a non-identity arrangement. Candidate 0 is the time-based ordering; a non-zero winner means the time-based heuristic alone would have produced a reconstruction with a lower score than the winner; in most cases the winner passes every check, while in a small number of iKP-family protocols the winner has strictly fewer failed checks.
distinguish the matching sessions in these cases.
Performance scaling. Table 5 reports the reconstruction cost as a function of N, measured with the standard JDK provider on the full 121-protocol suite. The single-session-equivalent total grows from 54.2s at N=1 to 60.9s at N=2 and 87.8s at N=3. Docker execution dominates at every session count (41.6s, 43.1s and 44.0s respectively), and the stages that do not scale with N (PCAP extraction, session build, and JavaDocker generation) are essentially flat across the three session counts. The growth is concentrated in the three stages that scale with the candidate space (ObjCheck, Java code generation and Java execution), because the number of candidate arrangements grows with N: a K=2 protocol has a single candidate at N=1, two at N=2 and six at N=3.
The means of these three stages are, however, skewed by a small number of K≥2 protocols; the medians tell a clearer story. The median ObjCheck cost is 3.4s, 3.9s and 3.9s at N=1, N=2 and N=3 respectively; the median Java code generation cost is 1.0s, 1.2s and 1.0s; the median Java execution cost is 4.7s, 5.4s and 6.0s. For a typical protocol, therefore, the per-session reconstruction cost is essentially flat across N, and the increase in the mean is driven by the tail (protocols with K=2 and long message sequences, such as Orig_3KP_Fixed, which contribute a large fraction of the total at N=3). The absolute wall-clock cost remains dominated by Docker orchestration at every session count, as in the N=1 results of Section 4.4.
4.6. Additional Validation
The main evaluation uses compiler-generated implementations and the AnBx specifications they were compiled from. The three experiments below exercise aspects of the pipeline that the main evaluation does not cover: extraction from hand-written implementations (Section 4.6.1), discrimination of the checks on semantic content (Section 4.6.2), and detection of modifications to a valid reconstruction (Section 4.6.3).
| Stage | Operation | N=1 | N=2 | N=3 |
|---|---|---|---|---|
| 1 | JavaDocker generation | 726 | 1,090 | 781 |
| 2 | Docker execution (capture) | 41,553 | 43,135 | 43,988 |
| 3 | PCAP to streams | 754 | 798 | 773 |
| – | Protocol execution (from PCAP) | 733 | 637 | 854 |
| 4 | Session build | 262 | 259 | 261 |
| 5a | Stream matching (ObjCheck) | 3,557 | 5,431 | 15,062 |
| 5b | Java code generation | 1,693 | 2,537 | 7,363 |
| 5b | Java execution (validation) | 4,952 | 7,009 | 18,673 |
| Total (single-session eq.) | 54,230 | 60,896 | 87,755 |
Table 5: Reconstruction cost as a function of N (standard JDK provider, 121 protocol runs per session count, means in milliseconds). The JavaDocker, Docker, PCAP and session-build stages are independent of N and are included for completeness. ObjCheck, Java code generation and Java execution grow with the number of candidate arrangements: at N=3, a K=2 protocol has six candidates to reconstruct and score, against two at N=2 and one at N=1. The means of these three stages are therefore dominated by the K≥2 protocols (see the medians quoted in the text), and should not be read as a per-session cost.
4.6.1. Application to Hand-Written Implementations
We conducted three additional experiments to determine whether the reconstruction pipeline is specific to compiler-generated code, specific to code that uses the AnBxJ runtime library, or applicable to any Java implementation that uses Java serialisation over TCP. In the three experiments below, the object-to-step mapping that ObjCheck performs in Stage 5, Pass A (Section 3.6) was instead performed by a hand-written extractor.
Experiment 1: Tutorial_06. A minimal two-agent program, using AnBxJ exchanges five messages over a single TCP connection: three from server to client (String), one from client to server (String), and one from client to server (Crypto_SignedObject). Both agents ran on localhost, so the two directions share an IP address and the pairing stage distinguishes them by port alone. Stage 3 recovered the two directional streams, the hand-written extractor distributed the objects into five per-step files, and the reported classes matched the sent classes on every step, including anbxj. Crypto_SignedObject on step 4.
Experiment 2: Tutorial_07. To isolate the dependence on the AnBxJ library, we wrote a second two-agent program using only the standard JDK, with no AnBxJ jar on the classpath. The exchange has the same five-step structure as Experiment 1, with cryptographically wrapped objects on two steps: a javax.crypto.SealedObject wrapping a symmetrically encrypted String on step 3, and a java.security.SignedObject wrapping a signed String on step 4. These are the underlying types that AnBxJ wraps in Crypto_SealedObject and Crypto_SignedObject. Stage 3 and the extractor recovered all five objects with the expected classes. The wrapped objects were read back as opaque serialised values: the extractor requires no key material and neither decrypts nor verifies them.
Experiment 3: Hybrid RSA+AES. The third program, adapted from a public example of hybrid RSA+AES encryption over TCP¹, probes two wire-format paths that neither of the first two experiments exercises. It uses only the standard JDK. The exchange has four steps: the server sends an RSA-2048 public key; the client generates an AES-256 session key, wraps it with the server's public key, and sends the wrapped key; the server replies with the AES-encrypted message and a detached RSA signature. The public-key step is interface-typed: the server writes a java.security.PublicKey, which the JDK serialises as its internal concrete class sun.security.rsa.RSAPublicKeyImpl. The remaining three objects are raw byte[] arrays, serialised with the TC_ARRAY token. Stage 3 and the extractor recovered all four objects with the expected classes.
Interpretation. Together, the three programs show that the extraction stage depends only on the wire format. Tutorial_06 was written by hand rather than generated by the compiler and was recovered exactly, so object recovery does not require the implementation to have been produced by the AnBx compiler. Tutorial_07 uses only the standard JDK, with no AnBxJ jar on the classpath at any point, and was also recovered exactly, so the recovery does not depend on the AnBxJ runtime. The hybrid program covers two further wire-format paths, an interface-typed public key and raw byte[] arrays, and was recovered exactly as well, so the recovery is not limited to objects whose static type is the concrete class carried on the wire. Any Java program that puts Java-serialised objects, including cryptographically wrapped ones, on a TCP stream can therefore be reconstructed, given a channel-to-step map, regardless of the library it uses, of whether it was compiler-generated, and of the type of the objects on the wire. What the three experiments do not do is exercise the compiler-generated checks or the candidate-selection loop: the hand-written programs have no AnBx specification from which those checks are derived, and the recovered objects were therefore not validated against a type system, equality constraints, or freshness requirements. A hand-written implementation can be reconstructed without a formal model, given a channel-to-step map; validating the reconstruction still requires one.
4.6.2. Discrimination on a Role-Mapping Mismatch
The hand-written experiments do not exercise the defensive checks, so they cannot show that the checks discriminate between role mappings. We therefore constructed a pair of captures in which the wire structure is held constant and only the mapping from roles to agent identities varies.
The Carlsen specification was compiled twice with two different runtime role mappings. In the first, the three roles are instantiated as alice, bob, and charlie; in the second, as david, eve, and frank. The two captures have the same number of messages, the same types and arity at each step, and the same cryptographic structure; they differ only in the identity strings carried on the
https://github.com/mark4865/JavaCryptoClientServer wire. The compiled intruder role is identical in both cases, because the role-to-agent mapping is read from a properties file at runtime rather than baked into the compiled code. We then ran the intruder against each capture under each of the two check instantiations, yielding a four-cell matrix.
Table 6 reports the outcome. The diagonal cells pass every check. The off-diagonal cells fail at the intruder's equality checks on role identities (steps 1.2, 2.2, 2.3). All other checks (including the nonce equality check at step 2.4 and the well-formedness checks) pass in every cell. No other types of checks are generated for Carlsen. The failure is therefore specific to the identity comparison.
| checks from ref | checks from swap | |
|---|---|---|
| capture ref | PASS | FAIL (1.2, 2.2, 2.3) |
| capture swap | FAIL (1.2, 2.2, 2.3) | PASS |
Table 6: Role-mapping discrimination. The same compiled intruder is run against each capture under each check instantiation. Only the identity equality checks fire, and only in the off-diagonal cells.
The result is clear: the same capture that fails under one check instantiation passes under the other. The failure is therefore attributable to the mismatch between the check instantiation and the role mapping that produced the capture, not to any incidental property of either capture or of the compiled intruder. Together with the hand-written experiments of Section 4.6.1, this shows that the checks are not merely satisfied by well-formed messages; they respond to a semantic property of the trace relative to the specification instance against which the trace is validated.
4.6.3. Detection of Mutations in Reconstructed Traces
The role-mapping experiment of Section 4.6.2 shows that the checks reject a trace whose role mapping disagrees with the check instantiation, but it does not show that the framework detects arbitrary modifications of a valid reconstruction. Since the solution is presented as a validator rather than a deserialiser, it must be shown that modifications can be caught. We therefore applied three file-level mutations to the winning reconstruction of each protocol and measured the fraction detected by each of two runtime signals. The mutations act on the per-step .ser files, not on the PCAP: deletion removes the step at index of the first session (); duplication copies the first step file of the first session over the second (); and cross-session swap copies the step at index of the second session over the same position in the first (). A mutation is flagged by check failure if the passive intruder reports a failed check or exits non-zero, and flagged by check-count deficit if it executes fewer checks than the unmutated baseline. The two categories are mutually exclusive by attribution: a mutation that both fails a check and suppresses a later check is attributed to the check failure. Protocols whose unmutated baseline fails a check are excluded, because a mutation on an already-flagged trace cannot be attributed to the mutation. The check-count deficit is a runtime diagnostic and does not evaluate the completeness predicate of Definition 1 directly; the two are related but not equivalent, as discussed below.
Results. Table 7 reports the outcome over twenty protocols at N=1 and N=2. The twenty span the structural features the experiment exercises (, 2 to 10 steps per session, 6 to 52 checks per session), with one representative per protocol family to avoid near-identical check structures; all twenty are parallel-capable at N=2 and have a clean baseline at both session counts. Deletion is flagged in 34 of 40 traces, duplication in 28 of 40, and cross-session swap in 3 of 20, for a total of 65 of 100. Of those, 27 produce a check failure or nonzero termination and 38 produce only a check-count deficit; the remaining 35 mutations trigger neither signal. The attribution between the two signals is stable across N for every protocol.
| Mutation | N | Traces | By check failure | By check-count deficit | Flagged |
|---|---|---|---|---|---|
| Deletion | 1, 2 | 40 | 8 | 26 | 34 |
| Duplication | 1, 2 | 40 | 16 | 12 | 28 |
| Cross-session swap | 2 | 20 | 3 | 0 | 3 |
| Total | 100 | 27 | 38 | 65 |
Table 7: Operational detection of mutations in reconstructed traces over twenty protocols. A trace is flagged by check failure if the passive intruder reports a failed check or exits nonzero, and by check-count deficit if it executes fewer checks than the unmutated baseline. The two columns are mutually exclusive by attribution: a mutation that both fails a check and suppresses a later check is attributed to the check failure. The Flagged column is their union. A check-count deficit is a runtime diagnostic and does not evaluate the completeness predicate of Definition 1 directly.
Interpretation. Two observations bound what the mutation experiment shows. First, the two runtime signals are independent of the formal properties they most resemble. Three protocols (SET_Rev, Rev_1KP, Rev_3KP) accept deletion without any runtime signal: the deleted step file is absent so the trace is incomplete by Definition 1, yet the middle step carries no checks that depend on its content, so the executed validation activity is unchanged. The divergence also runs the other way: a check failure aborts the current step and skips any later checks within it, so a reconstruction with all step files present can produce a check-count deficit, just as one with a missing step file can produce none. Second, detection depends on whether the specification places a check whose outcome depends on the mutated content, not on the protocol's step count, its check count, or the number of parallel sessions. This explains why the three longest protocols (SET_Rev, Rev_1KP, Rev_3KP) are not flagged by deletion, and why some protocols accept duplication: the substituted content either satisfies the checks generated for the affected step, or the step carries no content-dependent checks. Cross-session swap is detected in three of twenty protocols (Otway-Rees, SET_Orig, H530), the three that expose values on the affected step that the intruder can compare against session-specific state; in the remaining seventeen the affected step carries symmetric ciphertext or content whose value does not differ between the two sessions. This is what the Dolev-Yao model predicts: a passive adversary without the session key cannot distinguish two ciphertexts of the same shape. The limit is on the intruder's information, not on the framework's design.
5. Discussion and Limitations
In this section we discuss the results presented in Section 4 and analyse their limitations.
5.1. Discussion
What the toolchain demonstrates. The passive Dolev-Yao intruder model can be instantiated in practice. A passive adversary with knowledge of the protocol specification can extract serialised Java objects from captured network traffic, reconstruct the protocol state, and validate that the observed messages are well-formed according to the protocol's type system and knowledge sets. This is the threat model underlying bulk surveillance operations that record network traffic for later analysis, and the toolchain provides a concrete mechanism for understanding what such an adversary can derive from captured traffic. It also forms a practical bridge between formal specifications and concrete traffic: the defensive checks enable automated consistency checking of captured traces against specifications, providing diagnostic information that can guide further investigation. The mutation experiment of Section 4.6.3 characterises the limits of this diagnostic capability; the evidence is presented there and not repeated here.
What the checks can and cannot detect. The accuracy figures of Section 4.4 conceal a distinction that matters for interpreting the checks. At , every check failure is a downstream consequence of a missing object: because checks run only on recovered objects, a missing value either skips the corresponding check or breaks a later equality that depends on it, and no protocol with a failed check recovers every object. At the iKP-family protocols break this pattern: they recover every expected object and yet fail cross-session freshness checks, because no candidate arrangement pairs the matching sessions across channels. The distinction separates what the checks can detect from what they cannot: they detect structural inconsistencies in recovered messages, but they do not resolve an ambiguity in the session grouping. The latter is a limit of the enumeration strategy, not of the checks themselves.
Cost and provider dependence. The reconstruction-specific stages are inexpensive relative to capture and storage (Section 4.4), which makes the pipeline suitable for interactive analysis and forensic investigation, though not for real-time traffic analysis; real-time analysis is in any case not the primary concern of a harvest now, decrypt later strategy, which focuses on retrospective analysis of stored traffic. A related observation is that the cryptographic provider is a property of the target implementation, not of the analyst. Provider-specific failures should therefore be treated as artefacts of the implementation, not as evidence about the protocol.
Candidate selection is not a fixed property. The score-based selection of Section 3.7 is necessary, not merely an optimisation on the time-based heuristic (Table 4). More importantly, the winning candidate is not fixed across session counts of the same protocol: Carlsen selects candidate 1 at and candidate 0 at , and the arrangement that the heuristic produces at fails two checks while the same arrangement at passes all of them. We cannot attribute this to itself, since the runs differ in timing, in the number of connections, and in the candidate space. What the observation establishes is that the winning candidate is not a static property of the protocol alone, and that score-based selection is required to identify the best-scoring arrangement for each individual reconstruction.
5.2. Limitations
No decryption without keys. Encrypted traffic cannot be decrypted without the appropriate cryptographic keys. For protocols that provide forward secrecy, such as TLS 1.3, a passive adversary cannot recover the plaintext even if long-term keys are later compromised. Our toolchain is therefore best suited for evaluating protocols that lack forward secrecy, or for analysing traffic that has been decrypted through other means.
Formal-model limitations. Our approach requires a formal specification of the protocol in the AnBx language, from which the compiler derives both the defensive checks and the channel-to-step map that Stage 5 uses. The toolchain can therefore only be used for protocols that have been modelled and verified; undocumented protocols would require manual reverse engineering. The handwritten experiments of Section 4.6.1 clarify the boundary: the extraction stage can run on implementations the analyst did not generate, but a channel-to-step map must still come from somewhere, from the specification, as in this work, or from an analysis of the implementation or of the captured trace. Even with a specification in hand, the language supports stateless protocols and those with sequence numbers, but not complex stateful behaviour such as session resumption or key rotation; this would require extensions to both the language and the pipeline. Finally, the analysis is symbolic, and does not account for probabilistic or side-channel attacks.
Implementation-level limitations. Three engineering limitations are worth noting. First, the toolchain relies on deployment metadata, expressed in our implementation as the .properties file. sessionbuild.py derives the number of connections per session from the channel structure, and the expected channel order guides object-to-step assignment; a PCAP whose network configuration does not match the file will fail during session build or produce an incorrect channel assignment. Second, the candidate space for multi-session reconstruction grows as , and sessionbuild.py caps enumeration at 120 arrangements, falling back to a heuristic set above the cap; this set is sufficient only if the correct arrangement is among the enumerated candidates, which is not guaranteed. Third, the scoring function is a heuristic lexicographic tuple, and the pipeline reads its inputs from textual markers (CHECK # <id> and check FAILED!) emitted by the AnBxJ library rather than from a structured report interface. An incorrect arrangement could pass every defensive check by coincidence and tie with the correct one, and a change to the library's output format would silently stop the parser from matching.
Java-specific implementation. The current implementation is tied to Java: the extraction stage (outparse.py and ObjCheck) parses Java's wire format, and the generated code deserialises Java objects via ObjectInputStream. The pipeline should therefore only be run on PCAP files from trusted sources or within isolated environments, since Java deserialisation vulnerabilities are well-documented [20]. The format dependency is confined to the extraction stage; the rest of the pipeline operates on the extracted objects rather than on bytes.
Scope of evaluation. The benchmark evaluates reconstruction under controlled captures generated from known implementations and specifications. All captures are self-generated: in all three experiments we ran the implementations and captured the traffic, though in the third the code was written independently. The evaluation therefore establishes technical feasibility and pipeline robustness, but does not establish performance on independently captured operational traffic. We are not aware of any public corpus of captures of Java-serialised protocol executions against which the pipeline could be validated; producing one would be a useful contribution in its own right.
6. Related Work
Our work is positioned at the intersection of several research areas: global surveillance, attack trace reconstruction, model-based security testing, protocol reverse engineering, passive adversary models, network forensics, and code generation from formal models.
6.1. Global Surveillance
The surveillance infrastructures that instantiate the passive adversary model have been analysed extensively in the geopolitical, economic, and sociological literature. Zuboff [26, 27] frames the corporate form as “surveillance capitalism”, an economic logic that commodifies human experience; Penney’s survey of over 1,200 internet users [28] provides evidence of the resulting “chilling effect”, and Sklansky [29] terms the propagation of this effect beyond direct targets the “stultification thesis” of surveillance.
The operational feasibility of such passive surveillance has been quantified by Blanco-Romero et al. [3], who model the economics of harvest now, decrypt later attacks against TLS 1.2, TLS 1.3, QUIC, and SSH. Their analysis demonstrates that the storage costs of retaining intercepted ciphertext are economically trivial for state-level actors (a 1% selective harvest of global traffic is estimated at approximately $1.1 billion annually, well within national intelligence budgets) and that long-term retention on magnetic tape media incurs near-zero operational cost over multi-decade timeframes. Where Blanco-Romero et al. quantify the economics of storing and decrypting captured traffic, our reconstruction pipeline provides the forensic mechanism to validate concrete protocol traces against formal specifications.
6.2. Attack Trace Reconstruction
A direct precursor to our work is the automatic generation of attack specifications and implementations from OFMC traces by Garcia and Modesti [14]. That work introduced a compiler extension that takes an OFMC attack trace and produces both an AnBx specification that includes the intruder's actions and executable Java code for an active intruder that realises the attack. The extension is limited to a single protocol session. Our present work extends this in three significant directions. First, we operate on concrete network traffic (PCAP files) rather than abstract attack traces, extracting the actual serialised objects that correspond to the abstract messages. Second, we model a passive intruder that observes and validates captured traffic, rather than an active one that manipulates it; the generated code therefore reads from files rather than the network and performs defensive checks on the reconstructed messages instead of executing an attack strategy. Third, our pipeline handles multiple parallel sessions, whereas attack trace reconstruction is limited to a single session. The two approaches are complementary: attack trace reconstruction produces a concrete attack implementation from a symbolic counterexample, whereas our pipeline validates captured traffic against the specification.
6.3. Model-Based Security Testing
Several approaches have explored the bridge between formal models and implementation testing. Sivelle et al. [30] synthesise implementations of secure protocols and attacks from abstract models, compiling symbolic attacks to F* code; Ghabri et al. [31] compile symbolic attacks to protocol implementation tests; and the model-based testing approaches of Dadeau et al. [32] and Maatoug et al. [33] generate tests from models but do not operate on captured network traffic. Armando et al. [34] and the SPaCIoS Tool [35] generate and execute security tests from a formal description and a model of the attacker, and SecureMDD [36] and MobSTer [37] derive test cases from higher-level models. A more recent direction combines model learning with formal analysis, extracting an implementation model and verifying it against an Applied Pi calculus specification [38]; our approach assumes the specification is known and focuses on the reconstruction of concrete traffic rather than on model extraction. Mutation-based testing, as in Dadeau et al. [32], generates negative test cases by mutating the formal model; our mutation experiment of Section 4.6.3 plays an analogous role at the trace level. The work by Ammann et al. [39] on DY Fuzzing combines formal Dolev-Yao models with cryptographic protocol fuzz testing, but focuses on active fuzzing rather than passive trace reconstruction.
6.4. Protocol Reverse Engineering
Protocol reverse engineering (PRE) infers specifications from traffic or from implementations, whereas we validate traffic against a known specification. The two are complementary: PRE tools could generate candidate specifications for protocols that have not been formally modelled, which our pipeline could then validate. Most PRE tools operate on traffic. Netzob [40] infers both message formats and state machines through passive and active processes, and is representative of a family that also includes MARISSA [41] and Discoverer [42], which recover message formats by similarity-based clustering and type-based sequence alignment. A second group focuses on state machines rather than formats, including IPSMInfer [43] for industrial protocols and StruFSM [44] at the byte level. A third family analyses the implementation rather than the traffic alone: Polyglot [45] and Prospex [46] track data flows through memory to recover field boundaries, and AUTHSCAN [47] recovers web authentication protocols from implementations. Our approach provides a different and stronger form of guarantee, because it works from a verified formal model rather than inferring one, but it requires the specification to be available.
6.5. Passive Adversary Models
The Dolev-Yao model [4] provides the standard symbolic formalism for analysing cryptographic protocols. While the active intruder has received extensive attention in formal verification, the passive adversary has been studied in fewer contexts. Delaune and Jacquemard [9] extend the Dolev-Yao model to capture offline dictionary attacks, augmenting the deduction system with probabilistic encryption and guessing, and establish that the intruder deduction problem in this extended model is decidable in PTIME. Baudet et al. [10] develop a general framework for comparing formal and computational models in the presence of passive adversaries. These works formalise what a passive adversary can deduce from observed messages and when it can distinguish between two sets of observations, the core capabilities of a passive intruder. Our work addresses a different question: what a passive adversary can reconstruct at the application protocol level, given knowledge of the specification. Rather than solving symbolic constraints over observed terms, we extract and validate the actual protocol messages from captured PCAP files, performing the defensive checks derived by the compiler from the specification.
6.6. Network Forensics and Traffic Analysis
Network forensics tools such as Wireshark, its command-line counterpart TShark [11], Tcpdump [48], and Zeek [49] capture and analyse network traffic, reconstruct flows, extract application-layer protocols, and perform deep packet inspection. Wireshark's "Export Objects" feature supports HTTP and SMB, and NetworkMiner [50] extracts files and images while performing passive OS fingerprinting.
TShark is particularly relevant to our work, as it enables scriptable extraction of packet data. We use its tcp.stream, ip.addr, and data fields to identify TCP streams and extract application-layer payloads. Zeek is representative of the more capable end of this spectrum: it passively analyses traffic and generates structured logs for over 40 application-layer protocols, but its analysis is limited to known protocols with established dissectors, and it cannot inspect encrypted payloads or validate protocol semantics against a formal specification. Despite these capabilities, network forensics tools operate without semantic understanding of security protocols: they can reconstruct TCP streams and display message bytes, but they cannot determine whether a captured sequence of messages satisfies a security goal such as authentication or secrecy. Our toolchain extends these tools by providing protocol-level reconstruction and security validation. Where Wireshark can show the raw bytes of a message, our tool can determine whether those bytes, when deserialised, form a well-formed protocol message consistent with the specification. The jpcap2ser.py and outparse.py scripts provide a generic mechanism for extracting serialised Java objects from TCP streams, and the generated intruder code uses the protocol specification to validate the reconstructed trace against the expected sequence of steps.
6.7. Code Generation from Formal Models
Several tools generate implementations from formal protocol models. JavaSPI [51] generates Java code from Spi Calculus specifications with a formal soundness proof; Expi2Java [52] generates Java code from extended Spi Calculus models; Meng et al. [53] generate Java code from CryptoVerif models; and Modular Choreographies [54] compiles Alice & Bob communication syntax to Java via the Choral language. Recent work on verified compilers for security protocols, such as Noise* [55] and Molly [56], provides machine-checked correctness proofs for specific protocol frameworks, and Arquint et al. [57, 58] present a generic methodology for modular verification of security protocol implementations.
The AnBx compiler [13, 12] generates Java code from AnB/AnBx specifications, deriving defensive checks from the protocol's knowledge sets; these checks operationalise the analysis and synthesis operations of the symbolic Dolev-Yao model on concrete messages. We extend this compiler with a reconstruction pipeline that operates on captured traffic rather than on a specification alone, and the resulting work differs from other code generation approaches in two ways. First, our primary contribution is reconstruction from captured traffic rather than code generation from a specification; the code generation is a means to replay and validate the captured trace. Second, our generated code implements a passive intruder that reads from files rather than the network, together with the ObjCheck class that extracts individual objects from the captured streams. Table 8 summarises the resulting differences.
| Approach | Input | Output | Exec | PCAP |
|---|---|---|---|---|
| OFMC [5], ProVerif [6], Tamarin [7] | Symbolic model | Abstract trace | – | – |
| Attack trace reconstruction [14] | OFMC trace | AnBx specification and Java code (active) | ✓ | – |
| Protocol reverse engineering (Netzob, IPSMInfer, etc.) | PCAP | Inferred protocol model | – | ✓ |
| Network forensics (Wire-shark, Zeek, etc.) | PCAP | Packets/flows | – | ✓ |
| JavaSPI [51], Expi2Java [52] | Spi Calculus | Java code | ✓ | – |
| Modular Choreographies [54] | Alice & Bob | Java code | ✓ | – |
| Model-based security testing (SPaCIoS [35], SecureMDD [36], Mob-STER [37]) | Model + goals | Tests / attacks | ✓ | – |
| Model learning and fuzzing (Tian [38], Ammann [39]) | Model / implementation | Verified model / test inputs | ✓ | – |
| Our work | PCAP + AnBx | Java intruder (passive) and ObjCheck | ✓ | ✓ |
Table 8: Comparison of related work on formal analysis, protocol reconstruction, and validation.
6.8. Comparison of Approaches
Table 8 summarises the key differences between our approach and existing tools. We are not aware of an existing tool that combines all three: PCAP input, executable output, and validation against a formal specification. The closest prior work is the attack trace reconstruction of Garcia and Modesti [14], which we extend by taking captured traffic as input, extracting the serialised objects from the PCAP, validating the reconstruction against the protocol specification through the generated ObjCheck class and passive intruder role, and handling multiple parallel sessions rather than a single one. Our approach fills a gap by providing a link between formal verification and operational security analysis.
7. Conclusion and Future Work
We presented an automated, specification-guided framework for reconstructing passive Dolev-Yao intruder executions from captured network traffic. The framework takes a PCAP capture produced under a passive man-in-the-middle configuration and a protocol specification in AnBx, and generates executable Java code that reconstructs the captured trace and evaluates the defensive checks derived by the compiler from the specification. The generated intruder does not modify traffic; it observes, reconstructs, and validates. The framework's contributions are set out in Section 1 and substantiated in Sections 3–4.
In brief, it provides an operational instantiation of a passive Dolev-Yao intruder, a PCAP-to-protocol reconstruction pipeline, specification-guided candidate selection using Dolev-Yao-derived consistency checks, and an evaluation over 121 protocols under multiple sessions, alternative cryptographic providers, third-party Java traffic, role-mapping mismatches, and controlled mutations. The toolchain is a proof-of-concept laboratory model of one stage of passive surveillance analysis.
The evaluation shows that the approach is feasible in practice. With the standard JDK provider, the pipeline achieves 94.2% successful reconstruction at and 89.3% on the 112 parallel-capable protocols at and , while recovering approximately 97% of expected objects. The extraction stage is independent of the compiler and runtime library, and the defensive checks respond to semantic mismatches and to several classes of mutation. These results establish a concrete link between formal protocol specifications and concrete network traffic: the checks are derived from the specification, not the implementation, and can reject traces that are structurally well formed but inconsistent with the specification instance.
The significance of the work lies in bridging formal verification and practical network analysis. Verification tools operate on abstract models and produce symbolic traces; network forensics tools display packets but lack protocol semantics. The toolchain uses a formal specification to interpret captured traffic, while remaining independent of whether encrypted payloads can be decrypted. In a harvest now, decrypt later setting, this means the protocol-level structure of a captured execution can be recovered and validated before keys become available.
Several directions remain for future work. Extending the compiler with post-quantum primitives would allow the pipeline to be applied to traffic whose long-term confidentiality is threatened by retrospective quantum decryption. Implementing the extraction stage for Protocol Buffers would broaden the toolchain beyond Java serialisation. A further possibility is to reduce the pipeline's dependence on externally supplied deployment metadata: both the .properties file and the channel-to-step map used in the hand-written experiments could be inferred from the implementation or from the observed message sequence, with candidate mappings validated against the specification. This would make the toolchain self-contained given only the specification and the PCAP. Finally, content-based pruning guided by reconstructed nonces would help scale multi-session reconstruction beyond the current enumeration cap and address the cross-session freshness failures noted in Section 4.5.
Data Availability. The source code and documentation for the compiler is available at https://paolo.science/anbx/ and the reconstruction pipeline and the experiments are available at https://github.com/paolo-mo/passive-dolev-yao-intruder.
Acknowledgement. The author would like to thank Rémi Garcia and Louis Holmes for insightful discussions. Furthermore, Louis ran preliminary experiments during his BSc dissertation, which helped to better understand some aspects of Java serialisation and stream extraction from PCAP files.
Declaration of generative AI and AI-assisted technologies in the writing process. During the preparation of this work the author used DeepSeek and ChatGPT to check grammar and improve the readability of the manuscript. After using these tool, the author reviewed and edited the content as needed and takes full responsibility for the content of the published article.
References
[1] E. Snowden, Permanent Record, Metropolitan Books, 2019.
[2] M. D. Green, I. Miers, Forward secure asynchronous messaging from puncturable encryption, in: 2015 IEEE Symposium on Security and Privacy, IEEE, 2015, pp. 305–320. doi:10.1109/SP.2015.26.
[3] J. Blanco-Romero, F. A. Mendoza, C. G. Rubio, C. Campo, D. D. Sánchez, On the practical feasibility of harvest-now, decrypt-later attacks (2026). arXiv:2603.01091.
[4] D. Dolev, A. Yao, On the security of public-key protocols, IEEE Transactions on Information Theory 2 (29) (1983). doi:10.1109/tit.1983.1056650.
[5] D. Basin, S. Mödersheim, L. Viganò, OFMC: A symbolic model checker for security protocols, International Journal of Information Security 4 (3) (2005) 181–208. doi:10.1007/s10207-004-0055-7.
[6] B. Blanchet, et al., Modeling and verifying security protocols with the applied pi calculus and proverif, Foundations and Trends in Privacy and Security 1 (1-2) (2016) 1–135. doi:10.1561/9781680832075.
[7] B. Schmidt, S. Meier, C. Cremers, D. Basin, Automated analysis of Diffie-Hellman protocols and advanced security properties, in: Computer Security Foundations Symposium (CSF), 2012 IEEE 25th, IEEE, 2012, pp. 78–94. doi:10.1109/csf.2012.25.
[8] D. Adrian, K. Bhargavan, Z. Durumeric, P. Gaudry, M. Green, J. A. Halderman, N. Heninger, D. Springall, E. Thomé, L. Valenta, B. VanderSloot, E. Wustrow, S. Zanella-Béguelin, P. Zimmermann, Imperfect forward secrecy: How Diffie-Hellman fails in practice, in: 22nd ACM Conference on Computer and Communications Security, 2015. doi:10.1145/2810103.2813707.
[9] S. Delaune, F. Jacquemard, Decision procedures for the security of protocols with probabilistic encryption against offline dictionary attacks, J. Autom. Reason. 36 (1-2) (2006) 85–124. doi:10.1007/S10817-005-9017-7.
[10] M. Baudet, V. Cortier, S. Kremer, Computationally sound implementations of equational theories against passive adversaries, Inf. Comput. 207 (4) (2009) 496–520. doi:10.1016/J.IC.2008.12.005. URL https://doi.org/10.1016/j.ic.2008.12.005
[11] Wireshark Foundation, TShark - the wireshark network analyzer (2024). URL https://www.wireshark.org/docs/man-pages/tshark.html
[12] M. Bugliesi, S. Calzavara, S. Mödersheim, P. Modesti, Security protocol specification and verification with anbx, Journal of Information Security and Applications 30 (2016) 46–63. doi:10.1016/j.jisa.2016.05.004.
[13] P. Modesti, AnBx: Automatic generation and verification of security protocols implementations, in: 8th International Symposium on Foundations & Practice of Security, Vol. 9482 of LNCS, Springer, 2015. doi: 10.1007/978-3-319-30303-1_10.
[14] R. Garcia, P. Modesti, Automatic generation of security protocols attacks specifications and implementations, Cyber Security and Applications 2 (2024) 100038. doi:10.1016/j.csa.2024.100038.
[15] G. Bella, F. Massacci, L. C. Paulson, Verifying the SET purchase protocols, J. Autom. Reason. 36 (1-2) (2006) 5–37. doi:10.1007/S10817-005-9018-6.
[16] M. Bellare, J. A. Garay, R. C. Hauser, A. Herzberg, H. Krawczyk, M. Steiner, G. Tsudik, E. V. Herreweghen, M. Waidner, Design, implementation, and deployment of the ikp secure electronic payment system, IEEE J. Sel. Areas Commun. 18 (4) (2000) 611–627. doi:10.1109/49.839936.
[17] S. Mödersheim, Algebraic properties in alice and bob notation, in: Proceedings of the The Forth International Conference on Availability, Reliability and Security, ARES 2009, March 16-19, 2009, Fukuoka, Japan, IEEE Computer Society, 2009, pp. 433–440. doi:10.1109/ARES.2009.95.
[18] U. Carlsen, Generating formal cryptographic protocol specifications, IEEE Symposium on Research in Security and Privacy (1994) 137–146.
[19] Oracle Corporation, Java Object Serialization Specification (2026). URL https://docs.oracle.com/en/java/javase/21/docs/specs/serialization/index.html
[20] I. Sayar, A. Bartel, E. Bodden, Y. Le Traon, An in-depth study of java deserialization remote-code execution exploits and vulnerabilities, ACM Transactions on Software Engineering and Methodology 32 (1) (2023) 1–45. doi:10.1145/3554732.
[21] R. M. Needham, M. D. Schroeder, Using encryption for authentication in large networks of computers, Commun. ACM 21 (12) (1978) 993–999. doi:10.1145/359657.359659.
[22] T. Y. C. Woo, S. S. Lam, A lesson on authentication protocol design, ACM SIGOPS Oper. Syst. Rev. 28 (3) (1994) 24-37. doi:10.1145/182110.182113.
[23] M. Satyanarayanan, Integrating security in a large distributed system, ACM Trans. Comput. Syst. 7 (3) (1989) 247-280. doi:10.1145/65000.65002.
[24] M. Tatebayashi, N. Matsuzaki, D. B. N. Jr., Key distribution protocol for digital mobile communication systems, in: G. Brassard (Ed.), Advances in Cryptology - CRYPTO '89, 9th Annual International Cryptology Conference, Santa Barbara, California, USA, August 20-24, 1989, Proceedings, Vol. 435 of Lecture Notes in Computer Science, Springer, 1989, pp. 324-334. doi:10.1007/0-387-34805-0_30.
[25] S. International Organization for Standardization, Genève, ISO/IEC 9798-2:2008, Information technology – Security techniques – Entity Authentication – Part 2: Mechanisms using symmetric encipherment algorithms, Third edition (2008).
[26] S. Zuboff, The Age of Surveillance Capitalism: The Fight for a Human Future at the New Frontier of Power, PublicAffairs, 2019.
[27] S. Zuboff, Surveillance capitalism or democracy? the death match of institutional orders and the politics of knowledge in our information civilization, Organization Theory 3 (3) (2022). doi:10.1177/26317877221129290.
[28] J. W. Penney, Internet surveillance, regulation, and chilling effects online: a comparative case study, Internet Policy Review 6 (2) (May 2017). doi: 10.14763/2017.2.692.
[29] D. A. Sklansky, Too much information: How not to think about privacy and the fourth amendment, Calif. L. Rev. 102 (2014) 1069. doi:10.15779/Z38TJ93.
[30] C. Sivelle, L. L. Debbah, M. Puys, P. Lafourcade, T. Franco-Rondisson, Automatic Implementations Synthesis of Secure Protocols and Attacks from Abstract Models, in: The 27th Nordic Conference on Secure IT Systems, NordSec, Reykjavik, Iceland, 2022. doi:10.1007/978-3-031-22295-5_13.
[31] H. Ghabri, G. Maatoug, M. Rusinowitch, Compiling symbolic attacks to protocol implementation tests, in: A. Bouhoula, T. Ida, F. Kamareddine (Eds.), Proceedings Fourth International Symposium on Symbolic Computation in Software Science, SCSS 2012, Gammarth, Tunisia, 15-17 December 2012, Vol. 122 of EPTCS, 2012, pp. 39-49. doi:10.4204/EPTCS.122.4.
[32] F. Dadeau, P. Héam, R. Kheddam, G. Maatoug, M. Rusinowitch, Model-based mutation testing from security protocols in HLPSL, Softw. Test. Verification Reliab. 25 (5-7) (2015) 684-711. doi:10.1002/stvr.1531.
[33] G. Maatoug, F. Dadeau, M. Rusinowitch, Model-Based Vulnerability Testing of Payment Protocol Implementations, in: HotSpot'14 - 2nd Workshop on Hot Issues in Security Principles and Trust, affiliated with ETAPS 2014, Grenoble, France, 2014. URL https://hal.inria.fr/hal-01089682
[34] A. Armando, G. Pellegrino, R. Carbone, A. Merlo, D. Balzarotti, From model-checking to automated testing of security protocols: Bridging the gap, in: A. D. Brucker, J. Julliard (Eds.), Tests and Proofs - 6th International Conference, TAP@TOOLS 2012, Prague, Czech Republic, May 31 - June 1, 2012. Proceedings, Vol. 7305 of Lecture Notes in Computer Science, Springer, 2012, pp. 3-18. doi:10.1007/978-3-642-30473-6_3.
[35] L. Viganò, The spacios project: Secure provision and consumption in the internet of services, in: Sixth IEEE International Conference on Software Testing, Verification and Validation, ICST 2013, Luxembourg, Luxembourg, March 18-22, 2013, IEEE Computer Society, 2013, pp. 497-498. doi:10.1109/ICST.2013.75.
[36] K. Katkalov, N. Moebius, K. Stenzel, M. Borek, W. Reif, Model-driven testing of security protocols with securemdd, in: New Technologies, Mobility and Security (NTMS), 2012 5th International Conference on, IEEE, 2012, pp. 1-5. doi:10.1109/ntms.2012.6208678.
[37] M. Peroli, F. D. Meo, L. Viganò, D. Guardini, Mobster: A model-based security testing framework for web applications, Softw. Test. Verification Reliab. 28 (8) (2018). doi:10.1002/stvr.1685.
[38] K. Tian, C. Gu, F. Wei, X. Zhang, J. Guo, Combining model learning and formal analysis: A framework for protocol implementation verification, Journal of Information Security and Applications 93 (2025) 104079. doi: 10.1016/j.jisa.2025.104079.
[39] M. Ammann, L. Hirschi, S. Kremer, Dy fuzzing: Formal dolev-yao models meet cryptographic protocol fuzz testing, in: 2024 IEEE Symposium on Security and Privacy (SP), IEEE, 2024, pp. 1481-1499. doi:10.1109/sp54263.2024.00096.
[40] G. Bossert, F. Guihéry, G. Hiet, Netzob : un outil pour la rétro-conception de protocoles de communication, in: Actes du Symposium sur la sécurité des technologies de l'information et des communications, Rennes, France, 2012, p. 43. URL https://centralesupelec.hal.science/hal-00763751
[41] P. Ruiz-Lezcano, D. Uroz, R. J. Rodríguez, Marissa: Efficient inference of network protocols using similarity digest clustering and multiple sequence algorithms, in: 2026 IEEE 11th European Symposium on Security and Privacy (EuroS&P), 2026, pp. 1299-1312. doi:10.1109/EuroSP68448.2026.00084.
[42] W. Cui, J. Kannan, H. J. Wang, Discoverer: Automatic protocol reverse engineering from network traces, in: 16th USENIX Security Symposium (USENIX Security 07), USENIX Association, Boston, MA, 2007, pp. 1–9. URL http://sur1.li/lobxku
[43] Y. Yang, Y. Geng, Q. Wei, R. Ma, Z. Wei, Ipsminfer: Industrial proprietary protocol state machine inference from network traces, International Journal of Critical Infrastructure Protection 49 (2025) 100765. doi:10.1016/j.ijcip.2025.100765.
[44] Z. Wang, S. Zhao, Y. Lu, Y. Ren, Z. Yan, Y. Li, H. Li, H. Zhu, Strufsm: Byte-level structural modeling for protocol finite state machine inference, Computer Networks 287 (2026) 112520. doi:10.1016/j.comnet.2026.112520.
[45] J. Caballero, H. Yin, Z. Liang, D. Song, Polyglot: automatic extraction of protocol message format using dynamic binary analysis, in: Proceedings of the 14th ACM Conference on Computer and Communications Security, CCS '07, Association for Computing Machinery, New York, NY, USA, 2007, pp. 317–329. doi:10.1145/1315245.1315286.
[46] P. M. Comparetti, G. Wondracek, C. Kruegel, E. Kirda, Prospex: Protocol specification extraction, in: 2009 30th IEEE Symposium on Security and Privacy, 2009, pp. 110–125. doi:10.1109/SP.2009.14.
[47] G. Bai, J. Lei, G. Meng, S. S. Venkatraman, P. Saxena, J. Sun, Y. Liu, J. S. Dong, AUTHSCAN: automatic extraction of web authentication protocols from implementations, in: 20th Annual Network and Distributed System Security Symposium, NDSS 2013, San Diego, California, USA, February 24-27, 2013, The Internet Society, 2013.
[48] The Tcpdump Group, tcpdump (2026). URL https://www.tcpdump.org
[49] Zeek Project, Zeek network security monitor (2026). URL https://zeek.org
[50] Netresec, Networkminer (2026). URL https://www.netresec.com/?page=NetworkMiner
[51] R. Sisto, P. Bettassa Copet, M. Avalle, A. Pironti, Formally sound implementations of security protocols with javaspi, Formal Aspects of Computing 30 (2) (2018) 279. doi:10.1007/s00165-017-0449-8.
[52] M. Backes, A. Busenius, C. Hritcu, On the development and formalization of an extensible code generator for real life security protocols, in: NASA Formal Methods, Springer, 2012, pp. 371–387. doi:10.1007/978-3-642-28891-3_34.
[53] B. Meng, C.-T. Huang, Y. Yang, L. Niu, D. Wang, Automatic generation of security protocol implementations written in java from abstract specifications proved in the computational model, IJ Network Security 19 (1) (2017) 138–153.
[54] L. Cruz-Filipe, A. Madsen, F. Montesi, M. Peressotti, Modular choreographies: Bridging alice and bob notation to java, Vol. 111, Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2023, pp. 3:1–3:18. doi: 10.4230/OASICS.MICROSERVICES.2020-2022.3.
[55] S. Ho, J. Protzenko, A. Bichhawat, K. Bhargavan, Noise: A library of verified high-performance secure channel protocol implementations, in: 2022 IEEE Symposium on Security and Privacy (SP), IEEE, 2022, pp. 107–124. doi:10.1109/sp46214.2022.9833621.
[56] D. J. Dougherty, J. D. Guttman, Molly: A verified compiler for cryptoprotocol roles (2023). doi:10.48550/ARXIV.2311.13692.
[57] L. Arquint, F. A. Wolf, J. Lallemand, R. Sasse, C. Sprenger, S. N. Wiesner, D. Basin, P. Müller, Sound verification of security protocols: From design to interoperable implementations, in: 2023 IEEE Symposium on Security and Privacy (SP), IEEE, 2023, pp. 1077–1093. doi:10.1109/sp46215.2023.10179325.
[58] L. Arquint, M. Schwerhoff, V. Mehta, P. Müller, A generic methodology for the modular verification of security protocol implementations, in: Proceedings of the 2023 ACM SIGSAC Conference on Computer and Communications Security, CCS '23, ACM, 2023, pp. 1377–1391. doi: 10.1145/3576915.3623105.