ProtocolIR-driven ProVerif model generation method for 5G-AKA protocol family
By using the ProtocolIR-driven approach, ProVerif models of the 5G-AKA protocol family are generated and verified, solving the problems of poor model generation stability and difficulty in error localization, and realizing stable, traceable and repairable automatic conversion from natural language to ProVerif models.
Patent Information
- Application Number
- CN202611371045.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-04
- Publication Date
- 2026-11-17
AI Technical Summary
The lack of inspectable and compilable intermediate representations in existing technologies leads to poor stability in the generation of ProVerif models for the 5G-AKA protocol family, making it impossible to structurally locate errors, easily losing differences between protocol variants, and creating a gap between verifier error messages and protocol semantic objects, making it difficult to accurately locate errors.
The ProtocolIR-driven approach generates candidate ProtocolIRs by standardizing user modeling requests and 5G-AKA protocol knowledge, and performs static verification and feedback remediation processes, including checks on structural integrity, reference closure, symbol consistency, message flow consistency, security target generability, and variant mapping consistency. It generates ProVerif model code and records IR-PV tracing mapping, calls the ProVerif verifier to execute the model code, and performs target coverage and variant reflection checks.
It achieves stable, traceable, and repairable automatic conversion from natural language protocol descriptions to ProVerif executable verification models, solves stability issues in the model generation process, and ensures that errors can be structurally located and protocol variant differences are accurately reflected.
Smart Images

Figure CN123122945A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mobile communication network security technology, and in particular to a method for generating ProtocolIR-driven ProVerif models for the 5G-AKA protocol family. Background Technology
[0002] The 5G Generation Authentication and Key Agreement (5G-AKA) is a core authentication mechanism in 5G mobile communication systems, widely used in mobile communication, vehicle-to-everything (V2X) communication, and edge access scenarios for user identity protection, network authentication, and session key establishment. This protocol family involves multi-party interactions between user equipment, serving network, and home network, encompassing complex mechanisms such as identity protection, key derivation, and anomaly handling. ProVerif, an automated cryptographic protocol verification tool based on applied π calculus and Horn clause reasoning, can perform symbolic model analysis of the confidentiality and authentication properties of protocols, making it an important means of formal verification of security protocols. Existing research has utilized tools such as ProVerif and Tamarin to abstract protocol roles, message flows, and attacker capabilities from standard documents or protocol improvement schemes, analyzing authentication, key confidentiality, and privacy properties, demonstrating that formal methods can reveal the relationship between protocol objectives and attacker capabilities. However, the conversion from protocol descriptions to ProVerif models still primarily relies on manual intervention. Modelers need to identify participants, message fields, long-term keys, random numbers, key derivation functions, events, and security queries from standard natural language text, paper proposals, or mechanism variant descriptions, and translate these into ProVerif statements, processes, and queries. Issues such as missing symbols, incorrect variable bindings, improper event instrumentation, or missing query mappings frequently occur, rendering the model unexecutable or unable to properly check security objectives. When the research scope expands to protocol families, local mechanism changes (such as adjustments to identity protection fields) often simultaneously affect multiple locations, including message structure, cryptographic functions, event parameters, and query mappings. Modelers must reprocess these relationships in each instance, making it difficult to maintain stable and traceable model construction.
[0003] To lower the modeling threshold, some studies have attempted to utilize large language models to assist in the formal verification of security protocols. One type of method directly generates ProVerif models from natural language descriptions; another type utilizes retrieval-enhanced generation, fixed templates, or verifier feedback repair mechanisms to improve generation quality. Research shows that directly generating symbolic protocol models using large language models has stability limitations, and a more reliable approach is to decompose the task into multiple intermediate stages and incorporate checks and transformations. However, directly generating ProVerif text compresses protocol semantic understanding, formal language encoding, and security goal construction into a single free text generation, lacking structural constraints and checkability. Even with the introduction of retrieval enhancements or text-level repair, it is still difficult to stably meet ProVerif's requirements for declaration scope, process structure, and query format; experimental data shows that the model with the direct generation path has a zero runnability. Existing methods typically rely on error messages to partially rewrite the final text after verification failures, but there is a gap between error messages and protocol semantic objects, making it difficult to determine whether the error stems from missing protocol objects, improper event instrumentation, missing query mappings, or unimplemented variant modifications. Text-level repair is not conducive to error localization and systemic correction.
[0004] Therefore, the lack of an inspectable and compilable intermediate representation of the protocol in the existing technology leads to a lack of structural constraints and stability in the ProVerif model generated by the large language model; there is a gap between the verifier error information and the protocol semantic object, and the error cannot be structurally located, making it difficult to distinguish whether it is a protocol object omission, improper event instrumentation, missing query mapping or unimplemented variant modification; the differences between protocol variants are easily lost during the generation or compilation process, and the final verified model often cannot truly reflect the variant protocol specified by the user. Summary of the Invention
[0005] The purpose of this invention is to provide a ProtocolIR-driven ProVerif model generation method for the 5G-AKA protocol family, which solves the problems in the prior art where the direct generation of ProVerif models is unstable, errors cannot be structurally located, and differences in protocol variants are easily lost due to the lack of inspectable and compilable intermediate protocol representations.
[0006] To achieve the above objectives, this invention provides a method for generating ProtocolIR-driven ProVerif models for the 5G-AKA protocol family, comprising the following steps: S1: Obtain user modeling requests and 5G-AKA protocol knowledge; perform task normalization processing on the user modeling requests to obtain standardized task data; and perform protocol knowledge construction processing on the 5G-AKA protocol knowledge to obtain protocol knowledge data. S2: Using the standardized task data and the protocol knowledge data as input, perform protocol object alignment, security target alignment, variant position alignment, and attacker hypothesis alignment, and fill the aligned task constraints and modeling constraints into the four types of objects of ProtocolIR to generate candidate ProtocolIR; the four types of objects of ProtocolIR include protocol flow structure objects, symbol and cryptographic primitive objects, security target binding objects, and variant and hypothesis description objects; S3: Perform static verification on the candidate ProtocolIR. The static verification includes structural integrity check, reference closure check, symbol consistency check, message flow consistency check, security target generativeability check, and variant mapping consistency check. If all checks pass, perform normalization processing on the candidate ProtocolIR to obtain a compilable ProtocolIR. If any check fails, generate a structured verification report and proceed to the feedback and repair process. S4: Using the compilable ProtocolIR as input, a deterministic compiler compiles the attacker hypothesis field in the compilable ProtocolIR into a Dolev-Yao attacker model, compiles the security target binding object in the compilable ProtocolIR into a ProVerif query statement, generates ProVerif model code according to a fixed mapping rule, and records the IR-PV tracing mapping between the fields of the compilable ProtocolIR and the ProVerif model code. S5: Call the ProVerif validator to execute the ProVerif model code, capture the execution result, and perform target coverage check and variant reflection check on the execution result; S6: If the ProVerif model code is successfully executed, the target coverage check and the variant reflection check pass, and the verification result corresponds to each security target in the user request, then the final ProVerif model and verification result are output; if any condition is not met, structured diagnostic information is generated, and local field repair is performed in the ProtocolIR layer based on the structured diagnostic information. Then, steps S3 to S5 are re-executed in the repaired ProtocolIR.
[0007] In step S3: The structural integrity check includes: checking whether the candidate ProtocolIR contains four top-level objects: the protocol flow structure object, the symbol and cryptographic primitive object, the security target binding object, and the variant and hypothesis description object; and checking whether the necessary internal fields of each top-level object exist. The reference closure check includes: traversing the message fields, function inputs and outputs, key dependencies, event bindings, and references in the candidate ProtocolIR to confirm that the referenced object has been declared in the corresponding location; The symbol consistency check includes checking the consistency of name, type, and purpose of the same protocol object in different fields. The message flow consistency check includes checking whether the message order, state transitions, and key dependencies conform to the knowledge constraints of the 5G-AKA protocol. The security target generability check includes: confirming that each security target in the standardized task data can be converted from the candidate ProtocolIR into a ProVerif query; The variant mapping consistency check includes: when the standardized task data contains a protocol variant description, confirming that the variant modification has been mapped to a specific message field, cryptographic function, authentication check condition, state transition location, or security target binding location in the candidate ProtocolIR.
[0008] In step S3: The structured verification report includes the failure type, field path, triggering rules, and remediation suggestions; The failure types include missing structure, undeclared reference, symbol conflict, incorrect process order, query cannot be generated, or incomplete variant mapping; The suggested fixes include adding objects, unifying symbol names, adjusting message order, adding event bindings, or completing variant mappings.
[0009] In step S4, the deterministic compiler compiles the attacker hypothesis field in the compilable ProtocolIR into a Dolev-Yao attacker model, specifically including: Public and private channels are determined based on the channel visibility in the attacker hypothesis field. Based on the attacker's initial knowledge in the attacker hypothesis field, determine the attacker's known public identity, public constants, and public parameters; The attacker's available constructors and destructor rules are determined based on the callable cryptographic operations in the attacker hypothesis field. Based on the capability boundaries in the attacker hypothesis field, it is determined that long-term keys, private random numbers, and derived session keys are not considered as initial knowledge for the attacker.
[0010] In step S4, the deterministic compiler generates the ProVerif model code in the following order: Type declaration, name declaration, function and equation, channel declaration, participant process, message sending and receiving statements, local computation and condition checking, event instrumentation, query statement and main process combination; The participating process is generated from the role set and message sequence in the protocol flow structure object; the event instrumentation and the query statement are generated from the security target binding object; and the functions and equations are generated from the cryptographic function table and key dependency relationships in the symbol and cryptographic primitives object.
[0011] In step S4, the IR-PV tracking mapping includes: The first mapping relationship between the protocol flow structure object and the participating process and message sending / receiving statement; the second mapping relationship between the symbol and cryptographic primitive object and the type declaration, name declaration, function declaration and equation declaration; the third mapping relationship between the security target binding object and the event declaration, event instrumentation and query statement; and the fourth mapping relationship between the variant and hypothesis description object and the channel declaration, public knowledge declaration, message modification location and function modification location.
[0012] In step S5, the target coverage check includes: The system extracts a set of security targets from the standardized task data, reads the security target binding objects from the compilable ProtocolIR, extracts the actually generated query set from the ProVerif model code, uses the IR-PV tracing mapping to confirm which security target binding field each query originates from, compares the correspondence between the set of security targets, the security target binding objects, and the query set, and confirms that each query in the query set has actually appeared in the execution result captured after the ProVerif verifier is executed; if any query corresponding to a security target does not appear in the execution result, the target coverage check fails.
[0013] In step S5, the variant response check includes: Extract variant modification content from the standardized task data, and determine whether the variant modification belongs to message field change, key derivation change, authentication check change, state transition change or security target binding change; Read the variant mapping record in the compilable ProtocolIR to confirm that the variant modification has been located in a specific message field, cryptographic function, authentication check condition, state transition location, or security target binding location. The IR-PV tracing map was used to check that the variant modifications had been compiled into the ProVerif model code; And in the execution results captured after the ProVerif verifier is executed, it is confirmed that the expected impact of the modified message structure, cryptographic function, authentication check conditions, state transition location, or security target binding in the model execution process still exists; if the expected impact of the modified variant cannot be confirmed in the execution results, the variant reflects the check failure.
[0014] In step S6, the structured diagnostic information includes failure type, failure stage, corresponding ProtocolIR field, relevant ProVerif code snippet, and repair suggestions. The feedback and repair process performs field completion, symbol unification, dependency correction, event binding supplementation, query template correction, or variant mapping completion at the ProtocolIR layer based on the repair suggestions. After the ProtocolIR is repaired, it re-enters the static verification process. The feedback repair process has a limited number of rounds. Once the limit is reached, it terminates and outputs the current diagnostic results and unresolved issues.
[0015] This invention discloses a ProtocolIR-driven ProVerif model generation method for the 5G-AKA protocol family. First, user modeling requests and 5G-AKA protocol knowledge are standardized into standardized task data and protocol knowledge data, respectively. After protocol object alignment, security target alignment, variant position alignment, and attacker hypothesis alignment, these data are filled into four types of objects in the ProtocolIR to generate candidate ProtocolIRs. Then, six static verifications are performed on the candidate ProtocolIRs: structural integrity, reference closure, symbol consistency, message flow consistency, security target generability, and variant mapping consistency. If the verifications pass, a deterministic compiler compiles the attacker hypothesis fields in the compilable ProtocolIR into a Dolev-Yao attacker model and compiles the security target binding objects into ProVerif query statements. ProVerif model code is generated according to fixed mapping rules, and IR-PV tracing mapping is recorded. The ProVerif verifier is then called to execute the model code, performing target coverage checks and variant reflection checks. If all checks pass, the final ProVerif model and verification results are output; otherwise, structured diagnostic information is generated, and local field repairs are performed at the ProtocolIR layer before the verification, compilation, and validation processes are re-executed. This invention introduces an inspectable and compilable intermediate protocol representation and IR-PV tracing mapping, enabling the model generation process to have structural constraints and diagnostics. It solves the problems of poor stability, inability to structurally locate errors, and easy loss of protocol variant differences in existing technologies that directly generate ProVerif models. It achieves stable, traceable, and repairable automatic conversion from natural language protocol descriptions to ProVerif executable verification models. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0017] Figure 1 This is a flowchart of the steps of the ProtocolIR-driven ProVerif model generation method for the 5G-AKA protocol family according to the present invention.
[0018] Figure 2 This is a schematic diagram of the structure of the main semantic objects carried by ProtocolIR in this invention.
[0019] Figure 3 This is a schematic diagram of the verification feedback-driven IR-level repair closed loop of the present invention. Detailed Implementation
[0020] The embodiments of the present invention are described in detail below. Examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, but should not be construed as limiting the present invention.
[0021] Please refer to Figures 1 to 3 This invention provides a method for generating a ProtocolIR-driven ProVerif model for the 5G-AKA protocol family, comprising the following steps: S1: Obtain user modeling requests and 5G-AKA protocol knowledge; perform task normalization processing on the user modeling requests to obtain standardized task data; and perform protocol knowledge construction processing on the 5G-AKA protocol knowledge to obtain protocol knowledge data. Specifically, the user modeling request describes the content to be verified in natural language, including the protocol version, protocol variants, security objectives, attacker assumptions, and expected output format. After reading the user modeling request, the system performs task standardization processing: first, it identifies the protocol name and version; then, it extracts the security objectives to be verified; next, it identifies the attacker assumptions and variant modifications; finally, it writes the output requirements and iteration constraints into the task fields, breaking down the task intent in natural language into structured fields, including protocol object fields, variant description fields, security objective fields, attacker capability fields, and output requirement fields, forming standardized task data.
[0022] The 5G-AKA protocol knowledge description describes how the protocol should be modeled, including participating entities, message sequences, key derivation relationships, authentication vectors, synchronization mechanisms, cryptographic functions, security attribute templates, and variant difference locations. After reading the protocol knowledge, the system performs protocol knowledge construction processing: first, it extracts the participants, message flow, and key objects; then, it organizes the cryptographic functions and their input-output dependencies; next, it converts security objectives such as authentication and confidentiality into reusable templates; finally, it aligns protocol variants with specific messages, functions, check conditions, or state transition locations in the basic flow; and it unifies and structures the terminology of role names, message fields, key names, cryptographic primitives, and security objective templates to form protocol knowledge data.
[0023] Standardized task data defines the target scope of this generation task, while protocol knowledge data defines the protocol facts and modeling boundaries that can be used during ProtocolIR generation. Both types of structured data are jointly passed to the next step.
[0024] S2: Using the standardized task data and the protocol knowledge data as input, perform protocol object alignment, security target alignment, variant position alignment, and attacker hypothesis alignment, and fill the aligned task constraints and modeling constraints into the four types of objects of ProtocolIR to generate candidate ProtocolIR; the four types of objects of ProtocolIR include protocol flow structure objects, symbol and cryptographic primitive objects, security target binding objects, and variant and hypothesis description objects; Specifically, the generation of candidate ProtocolIRs first relies on the alignment between standardized task data and protocol knowledge data. The system performs four types of alignment before generating ProtocolIRs: First, protocol object alignment, which maps the protocol version or variant name in the standardized task data to the base protocol entry or variant entry in the protocol knowledge data.
[0025] Second, security goal alignment, which maps the authentication, confidentiality, and other goals in user requests to event templates, secret object templates, or query templates in the protocol knowledge data.
[0026] Third, variant position alignment, which maps natural language variant descriptions to message fields, key derivation functions, authentication check conditions, or state transition positions in the basic protocol flow.
[0027] Fourth, attacker hypothesis alignment, which maps attacker capabilities in the task data to channel objects, public parameters, and observable message ranges in the protocol knowledge data.
[0028] After completing the above alignment, the system generates candidate ProtocolIRs within the field scope defined by the ProtocolIR mode. The protocol flow structure object records the protocol execution skeleton: the system first reads the protocol version and variant name from the standardized task data to determine whether to use the basic 5G-AKA flow or a variant flow; then it reads the participating entities, message order, and key authentication steps from the protocol knowledge data, and populates the role set, message sequence, and state transition fields. For each message, it records the sender, receiver, message name, message fields, preceding state, and following state. If the task involves a protocol variant, the variant description further constrains the message flow structure, indicating whether a certain message field has been added, deleted, replaced, or moved to another protocol step.
[0029] Symbols and cryptographic primitives describe names, variables, keys, random numbers, authentication tokens, cryptographic functions, and key derivation relationships appearing in the protocol. The system standardizes symbol names in protocol knowledge, mapping different representations of the same object in different documents to a unified field; subsequently, each symbol object is labeled with its type, generation source, usage location, and visibility. Long-term keys represent secret material shared between user equipment and the home network; RAND represents a random challenge in the authentication process; AUTN represents an authentication token; and K_AUSF and K_SEAF represent intermediate keys or session keys derived from upstream key material and session context. For cryptographic functions, the function name, input parameters, output object, and semantic category are recorded.
[0030] The security target binding object transforms the security properties in the user request into intermediate fields that can generate events and queries in the subsequent ProVerif model. The system first reads the target to be verified from the standardized task data, and then matches the corresponding security attribute templates from the protocol knowledge data to determine which protocol events, secret objects, or query patterns the target should be bound to. For authentication targets, it records the two parties involved in the authentication relationship, the event triggering position, and the corresponding relationship type; for confidentiality targets, it records the object to be protected, the protection stage, and the attacker's observable scope.
[0031] The variant and hypothesis description objects record the mechanism changes that differ from the basic 5G-AKA protocol in this modeling task, as well as the attacker hypotheses used in the verification process. The system determines whether the variant affects message structure, cryptographic computation, authentication checks, state updates, or security target binding, and writes this impact into the variant mapping field. The attacker hypothesis stores channel visibility, public knowledge, cryptographic operations that the attacker can invoke, and capability boundaries for subsequent use in building the Dolev-Yao attacker model.
[0032] The system also records field sources and object dependencies. Field sources indicate whether a ProtocolIR field originates from user task data, protocol knowledge data, or a combination of both. Object dependencies describe the constraints between different ProtocolIR objects; for example, security target binding depends on symbols and secret objects in cryptographic primitives, and message flow structure depends on role sets and message fields.
[0033] After the above processing, the generated candidate ProtocolIR contains four types of objects: protocol flow structure objects, symbol and cryptographic primitive objects, security target binding objects, and variant and hypothesis description objects. These objects together form a structured intermediate model, which is then passed to the static verification module.
[0034] S3: Perform static verification on the candidate ProtocolIR. The static verification includes structural integrity check, reference closure check, symbol consistency check, message flow consistency check, security target generativeability check, and variant mapping consistency check. If all checks pass, perform normalization processing on the candidate ProtocolIR to obtain a compilable ProtocolIR. If any check fails, generate a structured verification report and proceed to the feedback and repair process. Specifically, the static verification module receives four types of input: candidate ProtocolIRs, standardized task data, protocol knowledge data, and field source records. The verification process is performed in order from basic to semantics, including the following six types of checks: Structural integrity checks confirm whether the candidate ProtocolIR contains the top-level objects and critical fields necessary for subsequent compilation. The system first checks whether the candidate ProtocolIR contains four top-level objects: a protocol flow structure object, a symbol and cryptographic primitive object, a security target binding object, and a variant and hypothesis description object. It then delves into each object to further check for the presence of necessary fields. The protocol flow structure object should at least contain a set of participants, a message sequence, and a state position; the symbol and cryptographic primitive object should at least contain a name, variables, a key object, and a cryptographic function; the security target binding object should at least contain a target type, a target object, an event position, or a query template; and the variant and hypothesis description object should at least contain an attacker hypothesis field. If the standardized task data declares protocol variants, the candidate ProtocolIR must also contain a variant mapping field.
[0035] The reference closure check is used to confirm that all objects used in the Protocol IR have been declared in their respective locations. The system iterates through all references in the candidate Protocol IR: the sender and receiver appearing in the message sequence must exist in the participant set; the random number, key, authentication token, or response value used in the message field must exist in the symbol table; the input parameters of the cryptographic function must be traceable to their source in the preceding message, initial knowledge, or key derivation; the secret object in the security target binding must be a declared key or symbol; and the participants and message positions in the event binding must correspond to the protocol flow structure.
[0036] Symbol consistency checks are used to determine whether the name, type, and purpose of the same protocol object are consistent across different locations in a candidate ProtocolIR. The system performs checks in three aspects: name consistency to prevent the same object from using unaligned names in different fields; type consistency to prevent objects from being placed in locations that do not conform to protocol semantics; and purpose consistency to prevent contradictions between object visibility and usage.
[0037] The message flow consistency check is used to determine whether the message order, state transitions, and key dependencies in Protocol IR conform to the 5G-AKA protocol knowledge constraints. The system checks whether each message has a clearly defined sender, receiver, message fields, and stage; whether the message order satisfies the sequential dependencies in the protocol knowledge; whether a field used by a certain message has been generated by a preceding message, the initial key, or local computation; whether key derivation occurs after its input materials are available; and whether state transitions are consistent with the message sending / receiving and authentication check positions.
[0038] The security objective generability check is used to confirm that each security objective in the standardized task data can be converted from the candidate ProtocolIR into a subsequent ProVerif query. For confidentiality objectives, ProtocolIR must specify the secret object, object type, source of generation, and attacker observability; for authentication objectives, ProtocolIR must specify both ends of the authentication relationship, event name, event insertion position, and corresponding relationship type; for variant-related objectives, ProtocolIR also needs to specify whether the objective is bound to a modified message, function, authentication check, or state condition.
[0039] The variant mapping consistency check is triggered only when the standardized task data contains protocol variant descriptions. It confirms that the variant modifications described by the user have been applied to specific objects in the ProtocolIR. The system first determines the type of object involved in the variant description, such as message field changes, key derivation changes, authentication check changes, or state update changes. Then, it checks whether the candidate ProtocolIR records the modification location and content in the corresponding object. If multiple protocol variants exist in the same modeling task, and these variants simultaneously affect the same message field, key derivation function, authentication check condition, or state transition location, the system marks this as a variant conflict, and the conflict information is recorded in the variant mapping field.
[0040] If all six checks pass, the system performs normalization on the candidate ProtocolIR to form a compilable ProtocolIR. Normalization includes standardizing field naming, completing default fields that can be determined by the template, reorganizing the object order, freezing the source records of fields, and generating the index relationships required for subsequent compilation.
[0041] If any check fails, the system does not discard the entire candidate ProtocolIR directly, but instead generates a structured verification report. The verification report includes the failure type, field paths, triggering rules, and remediation suggestions. Failure types include missing structures, undeclared references, symbol conflicts, incorrect process order, queries that cannot be generated, or incomplete variant mappings. Remediation suggestions include supplementing objects, standardizing symbol names, adjusting message order, adding event bindings, or completing variant mappings. The verification report is then passed to the feedback remediation process.
[0042] S4: Using the compilable ProtocolIR as input, a deterministic compiler compiles the attacker hypothesis field in the compilable ProtocolIR into a Dolev-Yao attacker model, compiles the security target binding object in the compilable ProtocolIR into a ProVerif query statement, generates ProVerif model code according to a fixed mapping rule, and records the IR-PV tracing mapping between the fields of the compilable ProtocolIR and the ProVerif model code. Specifically, the deterministic compilation layer takes compilable ProtocolIR as its sole structured input. The core objects read by the compiler include four categories: protocol flow structure objects, symbol and cryptographic primitive objects, security target binding objects, and variant and hypothesis description objects.
[0043] This layer follows a deterministic mapping principle: the same compilable ProtocolIR generates a ProVerif model with a consistent structure under the same compilation rules. The compiler reads ProtocolIR objects in a fixed order and generates ProVerif code according to preset mapping rules.
[0044] Attacker Model Construction: The compiler first reads the attacker hypothesis fields from the variant and hypothesis description objects to construct the Dolev-Yao attacker model. The attacker model is described by several fields, mainly including channel visibility, attacker initial knowledge, invoked cryptographic operations, observable message range, and capability boundaries.
[0045] Channel visibility describes which communication channels are public to attackers and which remain private. If the standardized task data declaration uses a public channel attacker, the public channel field is mapped to the public channel declaration in ProVerif at compile time. Attacker initial knowledge records the public identity, public constants, public parameters, and public function symbols known to the attacker before the protocol begins. Callable cryptographic operations describe which public constructors and destructor rules the attacker can use. Observable message scope records the message objects that the attacker can obtain from public channels. Capability boundaries clarify that objects such as long-term keys, private random numbers, and derived session keys cannot be directly disclosed as attacker initial knowledge.
[0046] The compiler determines public and private channels based on channel visibility in the attacker hypothesis field; it determines the attacker's known public identity, public constants, and public parameters based on the attacker's initial knowledge in the attacker hypothesis field; it determines the constructors and destructor rules that the attacker can use based on the callable cryptographic operations in the attacker hypothesis field; and it determines that long-term keys, private random numbers, and derived session keys are not considered as the attacker's initial knowledge based on the capability boundaries in the attacker hypothesis field.
[0047] Security attribute binding and query generation: The compiler converts security target bindings in ProtocolIR into ProVerif executable events and queries.
[0048] For confidentiality objectives, the compiler reads the secret object field in ProtocolIR to determine the name, type, source of generation, and location of the object to be protected, and generates a confidentiality query for the secret object to determine whether an attacker can deduce the object given the channel and public knowledge.
[0049] For authentication objectives, the compiler reads the authentication relationship field in ProtocolIR to determine the participants at both ends of the authentication relationship, the event name, the event insertion position, and the corresponding relationship type. Event instrumentation is determined based on the protocol flow structure and the security objective binding object—initiation-type events are inserted where one party generates a challenge, sends authentication materials, or initiates the authentication process; completion-type events are inserted where the other party completes the authentication check, accepts the response, or confirms the session key. The compiler generates event declarations and event mapping queries in ProVerif.
[0050] For variant-related security targets, the compiler uses variant mapping fields to determine whether events and queries should be bound to the modified protocol location.
[0051] ProVerif model code generation: The compiler generates ProVerif model code in a fixed order: type declarations, name declarations, functions and equations, channel declarations, participating processes, message sending and receiving statements, local computation and condition checks, event instrumentation, query statements, and main process combination.
[0052] Type declarations are generated from the symbol types in the symbol and cryptographic primitive objects; name declarations are generated from long-term keys, private random numbers, public constants, and session-related objects; functions and equations are generated from the function table and key dependencies in the cryptographic primitive objects; channel declarations are generated from the channel visibility field in the attacker model; participant processes are generated from the role set in the protocol flow structure object, and each role process organizes input, output, local computation, and conditional judgments according to message sequences and state transitions; message sending steps are compiled into output statements on the corresponding channel, message receiving steps are compiled into input statements, and local authentication checks and key derivation steps are compiled into function calls, conditional judgments, or local bindings; event instrumentation and query statements are generated from the security target binding object.
[0053] IR-PV tracing mapping record: The compiler maintains the IR-PV tracing mapping while generating ProVerif code. This mapping record records the source relationship between ProtocolIR fields and ProVerif code fragments, mainly including four types of mappings: the first mapping relationship from protocol flow structure objects to participant processes and message sending / receiving statements; the second mapping relationship from symbol and cryptographic primitive objects to type declarations, name declarations, function declarations, and equation declarations; the third mapping relationship from security target binding objects to event declarations, event instrumentations, and query statements; and the fourth mapping relationship from variant and hypothesis description objects to channel declarations, public knowledge declarations, message modification locations, and function modification locations.
[0054] The compilation layer outputs three parts: ProVerif model code, IR-PV tracing mapping, and compilation logs.
[0055] S5: Call the ProVerif validator to execute the ProVerif model code, capture the execution result, and perform target coverage check and variant reflection check on the execution result; Specifically, the input to the verifier execution module includes four types of data: ProVerif model code generated by the deterministic compilation layer, standardized task data, compilable ProtocolIR and IR-PV trace mapping.
[0056] The system calls ProVerif 2.05 to execute the generated model, writes the ProVerif model code into the input of the model to be verified, calls the ProVerif command according to the preset execution parameters, and captures the standard output, error output, exit status, and execution time. The execution result is categorized into five statuses: syntax error, modeling error, query result, timeout status, and normal completion status.
[0057] For syntax errors and modeling errors, the system uses IR-PV tracing mapping to locate the errors and trace them back to the source fields in ProtocolIR. For successfully completed queries, the system further parses the security objectives corresponding to each query and organizes the parsed results into structured validation results.
[0058] The target coverage check is used to confirm whether all security targets in the user's request are covered by the generated model. The input to this check includes the set of security targets in the standardized task data, the security target binding objects in ProtocolIR, the actual set of queries generated in the ProVerif model, and the query results returned by ProVerif.
[0059] The specific implementation of the target coverage check is as follows: extract the set of security targets from the standardized task data; read the security target binding objects from the compilable ProtocolIR; extract the actual generated query set from the ProVerif model code; use IR-PV tracing mapping to confirm which security target binding field each query originates from; and compare the correspondence between the set of security targets, the security target binding objects, and the query set.
[0060] If a user requests verification of K_SEAF confidentiality, the generated model should contain a confidentiality query for K_SEAF, and this query must appear in the ProVerif execution result. If a security target exists in the standardized task data, but ProtocolIR is not bound to that target, or the ProVerif code does not generate a corresponding query, or the query is generated but not covered by the ProVerif execution result, then the target coverage check fails.
[0061] The variant reflection check is used to confirm whether the protocol variant differences in the user request are truly reflected in the ProtocolIR and ProVerif models. The input to this check includes variant descriptions in the standardized task data, variant mapping records in ProtocolIR, message structures, function declarations, equation rules, event locations, and query objects in the ProVerif model, as well as IR-PV tracing mappings.
[0062] The specific implementation of the variant reflection check is as follows: Extract variant modification content from standardized task data; determine whether the variant modification belongs to message field changes, key derivation changes, authentication check changes, state transition changes, or security target binding changes; read the variant mapping record in the compilable ProtocolIR to confirm that the variant modification has been located in a specific message field, cryptographic function, authentication check condition, state transition location, or security target binding location; use IR-PV tracing mapping to check whether the variant modification has been compiled into the ProVerif model code; and in the execution result captured after the ProVerif verifier is executed, confirm that the expected impact of the message structure, cryptographic function, authentication check condition, state transition location, or security target binding corresponding to the variant modification still exists during model execution; if the expected impact of the variant modification cannot be confirmed in the execution result, the variant reflection check fails.
[0063] S6: If the ProVerif model code is successfully executed, the target coverage check and the variant reflection check pass, and the verification result corresponds to each security target in the user request, then the final ProVerif model and verification result are output; if any condition is not met, structured diagnostic information is generated, and local field repair is performed in the ProtocolIR layer based on the structured diagnostic information. Then, steps S3 to S5 are re-executed in the repaired ProtocolIR.
[0064] Specifically, the system uses a multi-condition joint determination to determine whether the modeling passes. Passing this round of modeling requires simultaneously meeting four conditions: First, the ProVerif model can be successfully invoked and executed without any blocking syntax errors, modeling errors, or timeouts; second, the target coverage check passes, meaning each security target in the standardized task data has been bound in ProtocolIR, a query is generated in the ProVerif model, and the corresponding result is obtained in the verifier output; third, the variant reflection check passes, meaning the protocol variants described by the user have been passed from the task data to ProtocolIR and further reflected in the messages, functions, state conditions, events, or query objects of the ProVerif model; fourth, the verification results correspond item-by-item to the security targets in the user request, demonstrating whether the corresponding authentication or confidentiality is valid.
[0065] If all the above conditions are met, the system will output the final verification results, including the ProVerif model, the verification conclusions for each security objective, the objective coverage report, the variants reflecting the inspection results, and the execution log.
[0066] If any condition is not met, the system generates structured diagnostic information. This information includes the failure type, failure stage, corresponding ProtocolIR field, relevant ProVerif code snippets, and remediation suggestions. Failure types include syntax errors, type errors, missing queries, insufficient target coverage, unreflected variants, validation timeouts, or results that do not correspond. The failure stage indicates whether the problem occurred during post-compilation execution, query generation, target coverage, variant reflection, or result parsing. The corresponding ProtocolIR field is obtained through IR-PV tracing mapping. Remediation suggestions guide subsequent IR-level repairs.
[0067] The feedback repair module takes structured diagnostic information as input and performs local repairs on ProtocolIR, rather than regenerating the entire ProVerif model. IR-level repairs mainly focus on field completion, symbol unification, dependency correction, event binding supplementation, query template correction, and variant mapping completion.
[0068] If the diagnostic results show a missing query, the repair module returns to the security target binding object in ProtocolIR to supplement the secret object, event location, or query template; if the diagnostic results show inconsistent types, the repair module returns to the symbol and cryptographic primitive object to unify the symbol type or adjust the function input and output; if the diagnostic results show an undefined message field, the repair module returns to the protocol flow structure or symbol table to supplement the corresponding message field and source; if the diagnostic results show that the variant is not reflected, the repair module returns to the variant mapping field to clarify the message, function, authentication check, or state transition location affected by the variant.
[0069] The repaired ProtocolIR re-enters the static verification process in step S3. Only after the verification is passed will it proceed to the compilation in step S4 and the verification in step S5.
[0070] The system employs a limited-round feedback and repair mechanism to avoid infinite loops. The main verification-repair process defaults to no more than 3 rounds, and the IR static verification repair process no more than 2 rounds. If the user task or experiment configuration provides a custom number of rounds, the configured value will apply. If all pass conditions are met within the limited number of rounds, the process terminates and outputs the final result. If, after reaching the iteration limit, there are still blocking errors, missing targets, or unreflected variants, the system terminates the repair process and outputs the current failure diagnosis, uncovered targets, unreflected variant locations, and the result of the last ProVerif execution round.
[0071] In handling boundary conditions, the system prioritizes maintaining the locality and termination of the repair process. If multiple errors exist in the same round of diagnosis, the system first handles blocking issues such as missing structures, undeclared references, and type conflicts, and then handles issues such as insufficient target coverage and unreflected variants. If multiple variant modifications apply to the same message, function, or state condition, the system marks conflicting objects based on the field source record and variant mapping location, and outputs the conflicting fields and the scope of modifications to be confirmed in the verification report.
[0072] In summary, after the user inputs the modeling request and 5G-AKA protocol knowledge, the system standardizes these two types of input into standardized task data and protocol knowledge data, respectively. Through protocol object alignment, security target alignment, variant location alignment, and attacker hypothesis alignment, the system unifies the task constraints and modeling constraints into the four types of objects in ProtocolIR. The candidate ProtocolIR undergoes six static verifications—structural integrity, reference closure, symbol consistency, message flow consistency, security target generativeability, and variant mapping consistency—before being compiled into ProVerif model code by a deterministic compiler, and the IR-PV tracing mapping is recorded. After the ProVerif verifier executes the model, the system performs target coverage checks and variant reflection checks to ensure that the model covers both the user's security targets and reflects protocol variant differences. If any condition is not met, the system performs local repairs at the ProtocolIR layer and re-executes the verification, compilation, and validation processes, forming a closed loop. Through the synergistic effect of ProtocolIR intermediate representation, pre-compilation static verification, deterministic compilation, and IR-level feedback repair, the system achieves a stable, traceable, and repairable automatic conversion from natural language protocol descriptions to ProVerif executable verification models.
[0073] The above-disclosed embodiments are merely one or more preferred embodiments of this application and should not be construed as limiting the scope of this application. Those skilled in the art can understand that all or part of the processes for implementing the above embodiments and equivalent changes made in accordance with the claims of this application still fall within the scope of this application.
Claims
1. A method for generating ProtocolIR-driven ProVerif models for the 5G-AKA protocol family, characterized in that, Includes the following steps: S1: Obtain user modeling requests and 5G-AKA protocol knowledge; perform task normalization processing on the user modeling requests to obtain standardized task data; and perform protocol knowledge construction processing on the 5G-AKA protocol knowledge to obtain protocol knowledge data. S2: Using the standardized task data and the protocol knowledge data as input, perform protocol object alignment, security target alignment, variant position alignment and attacker hypothesis alignment, and fill the aligned task constraints and modeling constraints into the four types of objects of ProtocolIR to generate candidate ProtocolIR; The four types of objects in ProtocolIR include protocol flow structure objects, symbol and cryptographic primitive objects, security target binding objects, and variant and hypothesis description objects. S3: Perform static verification on the candidate ProtocolIR, including structural integrity check, reference closure check, symbol consistency check, message flow consistency check, security target generativeability check, and variant mapping consistency check; if all checks pass, perform normalization processing on the candidate ProtocolIR to obtain a compilable ProtocolIR; If any check fails, a structured verification report is generated and the process is transferred to the feedback and repair workflow. S4: Using the compilable ProtocolIR as input, a deterministic compiler compiles the attacker hypothesis field in the compilable ProtocolIR into a Dolev-Yao attacker model, compiles the security target binding object in the compilable ProtocolIR into a ProVerif query statement, generates ProVerif model code according to a fixed mapping rule, and records the IR-PV tracing mapping between the fields of the compilable ProtocolIR and the ProVerif model code. S5: Call the ProVerif validator to execute the ProVerif model code, capture the execution result, and perform target coverage check and variant reflection check on the execution result; S6: If the ProVerif model code is successfully executed, the target coverage check and the variant reflection check pass, and the verification result corresponds to each security target in the user request, then the final ProVerif model and verification result are output; if any condition is not met, structured diagnostic information is generated, and local field repair is performed in the ProtocolIR layer based on the structured diagnostic information. Then, steps S3 to S5 are re-executed in the repaired ProtocolIR.
2. The ProtocolIR-driven ProVerif model generation method for the 5G-AKA protocol family as described in claim 1, characterized in that, In step S3: The structural integrity check includes: checking whether the candidate ProtocolIR contains four top-level objects: the protocol flow structure object, the symbol and cryptographic primitive object, the security target binding object, and the variant and hypothesis description object; and checking whether the necessary internal fields of each top-level object exist. The reference closure check includes: traversing the message fields, function inputs and outputs, key dependencies, event bindings, and references in the candidate ProtocolIR to confirm that the referenced object has been declared in the corresponding location; The symbol consistency check includes checking the consistency of name, type, and purpose of the same protocol object in different fields. The message flow consistency check includes checking whether the message order, state transition, and key dependency conform to the 5G-AKA protocol knowledge constraints. The security target generability check includes: confirming that each security target in the standardized task data can be converted from the candidate ProtocolIR into a ProVerif query; The variant mapping consistency check includes: when the standardized task data contains a protocol variant description, confirming that the variant modification has been mapped to a specific message field, cryptographic function, authentication check condition, state transition location, or security target binding location in the candidate ProtocolIR.
3. The ProtocolIR-driven ProVerif model generation method for the 5G-AKA protocol family as described in claim 1, characterized in that, In step S3: The structured verification report includes the failure type, field path, triggering rules, and remediation suggestions; The failure types include missing structure, undeclared reference, symbol conflict, incorrect process order, query cannot be generated, or incomplete variant mapping; The suggested fixes include adding objects, unifying symbol names, adjusting message order, adding event bindings, or completing variant mappings.
4. The ProtocolIR-driven ProVerif model generation method for the 5G-AKA protocol family as described in claim 1, characterized in that, In step S4, the deterministic compiler compiles the attacker hypothesis field in the compilable ProtocolIR into a Dolev-Yao attacker model, specifically including: Public and private channels are determined based on the channel visibility in the attacker hypothesis field. Based on the attacker's initial knowledge in the attacker hypothesis field, determine the attacker's known public identity, public constants, and public parameters; The attacker's available constructors and destructor rules are determined based on the callable cryptographic operations in the attacker hypothesis field. Based on the capability boundaries in the attacker hypothesis field, the long-term key, private random number, and derived session key are determined not to be the attacker's initial knowledge.
5. The ProtocolIR-driven ProVerif model generation method for the 5G-AKA protocol family as described in claim 1, characterized in that, In step S4, the deterministic compiler generates the ProVerif model code in the following order: Type declaration, name declaration, function and equation, channel declaration, participant process, message sending and receiving statements, local computation and condition checking, event instrumentation, query statement and main process combination; The participating process is generated from the role set and message sequence in the protocol flow structure object; the event instrumentation and the query statement are generated from the security target binding object; and the functions and equations are generated from the cryptographic function table and key dependency relationships in the symbol and cryptographic primitives object.
6. The ProtocolIR-driven ProVerif model generation method for the 5G-AKA protocol family as described in claim 1, characterized in that, In step S4, the IR-PV tracking mapping includes: The first mapping relationship between the protocol flow structure object and the participating process and message sending / receiving statement; the second mapping relationship between the symbol and cryptographic primitive object and the type declaration, name declaration, function declaration and equation declaration; the third mapping relationship between the security target binding object and the event declaration, event instrumentation and query statement; and the fourth mapping relationship between the variant and hypothesis description object and the channel declaration, public knowledge declaration, message modification location and function modification location.
7. The ProtocolIR-driven ProVerif model generation method for the 5G-AKA protocol family as described in claim 1, characterized in that, In step S5, the target coverage check includes: The system extracts a set of security targets from the standardized task data, reads the security target binding objects from the compilable ProtocolIR, extracts the actually generated query set from the ProVerif model code, uses the IR-PV tracing mapping to confirm which security target binding field each query originates from, compares the correspondence between the set of security targets, the security target binding objects, and the query set, and confirms that each query in the query set has actually appeared in the execution result captured after the ProVerif verifier is executed; if any query corresponding to a security target does not appear in the execution result, the target coverage check fails.
8. The method for generating a ProtfocolIR-driven ProVerif model for the 5G-AKA protocol family as described in claim 1, characterized in that, In step S5, the variant reflection check includes: Extract variant modification content from the standardized task data, and determine whether the variant modification belongs to message field change, key derivation change, authentication check change, state transition change or security target binding change; Read the variant mapping record in the compilable ProtocolIR to confirm that the variant modification has been located in a specific message field, cryptographic function, authentication check condition, state transition location, or security target binding location. The IR-PV tracing map was used to check that the variant modifications had been compiled into the ProVerif model code; And in the execution results captured after the ProVerif verifier is executed, it is confirmed that the expected impact of the modified message structure, cryptographic function, authentication check conditions, state transition location, or security target binding in the model execution process still exists; if the expected impact of the modified variant cannot be confirmed in the execution results, the variant reflects the check failure.
9. The ProtocolIR-driven ProVerif model generation method for the 5G-AKA protocol family as described in claim 1, characterized in that, In step S6, the structured diagnostic information includes the failure type, failure stage, corresponding ProtocolIR field, relevant ProVerif code snippets, and repair suggestions; The feedback and repair process performs field completion, symbol unification, dependency correction, event binding supplementation, query template correction, or variant mapping completion at the ProtocolIR layer based on the repair suggestions. After the ProtocolIR is repaired, it re-enters the static verification process. The feedback repair process has a limited number of rounds. Once the limit is reached, it terminates and outputs the current diagnostic results and unresolved issues.
