Abstract
We propose a development method for security protocols based on stepwise refinement. Our refinement strategy transforms abstract security goals into protocols that are secure when operating over an insecure channel controlled by a Dolev-Yao-style intruder. As intermediate levels of abstraction, we employ messageless guard protocols and channel protocols communicating over channels with security properties. These abstractions provide insights on why protocols are secure and foster the development of families of protocols sharing common structure and properties. We have implemented our method in Isabelle/HOL and used it to develop different entity authentication and key establishment protocols, including realistic features such as key confirmation, replay caches, and encrypted tickets. Our development highlights that guard protocols and channel protocols provide fundamental abstractions for bridging the gap between security properties and standard protocol descriptions based on cryptographic messages. It also shows that our refinement approach scales to protocols of nontrivial size and complexity.
Keywords
Introduction
The fact that the development of even simple security protocols is error prone motivates the use of formal methods to ensure their security. The past decades have witnessed significant progress in post-hoc verification methods for security protocols based on model checking and theorem proving, such as [6,19,28,58,61]. However, methods for developing security protocols lag behind and protocol design remains more an art than a science.
In our view, a development method should be systematic and hierarchical. By this we mean that the development is decomposed into smaller steps that are easy to understand and that these steps should span well-defined abstraction levels leading the developer from requirements down to cryptographic protocols. Moreover, the resulting protocols should be secure in well-established attacker models and such claims should ideally be supported by machine-checked formal proofs. Stepwise refinement provides such a hierarchical development method. However, most existing refinement-based approaches to developing security protocols [15,17,24,26,29,42] fall short in at least one of these desiderata.
In this paper, we advocate a development method based on stepwise refinement that satisfies all requirements in our wish list. Its central element is a four-level refinement strategy, introduced in Section 3 and summarized in Table 1. This strategy allows developers to build models that incrementally incorporate the system requirements and environment assumptions. Each model constitutes an idealized functionality for subsequent refinements. Safety properties, once proved for a model, are preserved by further refinements.
Levels of the refinement strategy
Levels of the refinement strategy
Level 0 of our refinement strategy consists of abstract, protocol-independent models of security properties such as (reachability-based) secrecy and authentication. At Level 1, we introduce guard protocols consisting of protocol roles, their local state, and the basic sequencing of the protocol steps. The protocol agents communicate by accessing each other’s local states. At Level 2, the agents exchange plaintext messages over communication channels with intrinsic security properties, e.g., confidential or authentic channels. Accordingly, we call these protocols channel protocols. Finally, at Level 3, we arrive at standard cryptographic protocols, where we replace these messages by cryptographic messages transmitted over insecure channels controlled by a Dolev-Yao intruder. In our method, the functional and security requirements are established at the first two levels, while the last two levels incorporate the environment assumptions, i.e., the hostile distributed environment.
A central and novel feature of our approach is the use of guard protocols (L1) as an intermediate abstraction linking security properties (L0) and message-based protocols (L2–3). Guard protocols enable the straightforward abstract realization of security goals by adding security guards as necessary conditions for the execution of certain protocol steps. Different kinds of security guards ensure the preservation of properties such as secrecy, authentication, and recentness. For example, key secrecy means that only authorized agents may know a key. Accordingly, the steps of guard protocols where an agent A learns a key K contain a guard requiring that A is authorized to know K. For authentication, there are guards ensuring that the local state of an agent (partially) agrees with the state of another agent.
The security guards for secrecy and authentication specify conditions on the global state in terms of other agent’s local states. This constitutes an abstract form of communication. This abstraction simplifies proofs, but it is not directly implementable in a distributed setting. Hence, we implement these guards at Level 2 by receiving messages on channels with intrinsic security properties. The associated refinement proof naturally gives rise to invariants stating that the receiving of channel messages implies the security guards they implement. These invariants precisely state the security properties guaranteed by the messages. For example, a message containing a key K received on a confidential channel to an agent A may implement a guard authorizing A to learn K. The corresponding invariant guarantees that A is authorized to learn K from this message.
To validate the effectiveness of our refinement strategy, we developed different authentication and key establishment protocols from abstract specifications. In Section 3, we develop two simple unilateral authentication protocols as running examples illustrating our approach: the ISO/IEC 9798-3 protocol and the first two steps of the Needham-Schroeder-Lowe protocol. In Section 4, we show how to systematically develop an entire family of key transport protocols. This family consists of the Needham-Schroeder Shared-key protocol, the core of Kerberos 4 and Kerberos 5, and the Denning-Sacco protocol. Compared to the running examples from Section 3, these protocols are significantly more complex in their size and message structure and they exhibit additional features and security properties such as the use of timestamps, replay protection caches, encrypted tickets (double encryption), dynamically created communication channels, key confirmation, key freshness, key recentness, and session key compromise.
Contributions. We see our work making five main contributions to the state-of-the-art. Our first contribution is methodological and consists of a new method for developing security protocols that are correct-by-construction. Our initial models at Level 0 specify the security goals of the guard protocols at Level 1. These in turn determine the basic structure of entire families of protocols. Using the refinement strategy outlined above, we systematically refine these abstract models in a series of well-defined steps to protocols using cryptographic messages sent over an insecure channel. Our refinement strategy aims at proving security properties at the highest possible abstraction level. General results guarantee that these properties are preserved by subsequent refinements.
Our refinement strategy naturally gives rise to straightforward parametrized simulation relations between the state spaces of models at different levels. These relations are instantiated and used in refinement proofs. Moreover, the process of proving refinements helps us discover invariants. For example, the simulation relation linking Levels 2 and 3 usually expresses that the local states of the roles is untouched by the refinement and maps the cryptographic messages at Level 3 to messages on abstract channels at Level 2. An invariant that appears in such refinement proofs states that the honest agents’ long-term keys remain secret. This is the natural level of abstraction for this invariant. Typically, the other relevant security properties are already proved in earlier refinements.
Second, our development provides evidence that guard protocols and channel protocols constitute two fundamental abstractions that bridge the gap between security properties and standard protocol descriptions based on cryptographic messages. For the families of authentication and the key establishment protocols we present, the Levels 2 and 3 models refine a common Level 1 ancestor, even though they use different channel types, cryptographic primitives, and communication patterns. Hence, guard protocols enable a unified view of different protocol classes, which disappears at the lower abstraction levels. Moreover, the guarantees about protocol messages we achieve at Level 2 given by the invariants mentioned above are generally absent, or at best informally stated and reasoned about, in other approaches. By formalizing them, our approach fosters clear protocol designs and abstract, simple security proofs. Moreover, in standard protocol descriptions, secrecy and authentication are often not clearly separated (e.g., when using a secure channel providing both properties) or are interdependent (e.g., due to a layered use of cryptographic keys and operations). This is a source of complexity and errors and makes security protocols hard to design and understand. In contrast, guard protocols realize secrecy and authentication properties abstractly and independently. This facilitates the formal development of security protocols and underscores the central role that guard protocols can play in property-driven design approaches.
At the next level, channel protocols allow us to reason about a protocol’s security properties at a lower degree of complexity than with the Dolev-Yao intruder. The channels also enable a range of different realizations. For example, we may implement an authentic channel using signatures or MACs. Moreover, the communication structure may change from Level 2 to 3. For instance, an abstract key server may independently distribute keys on secure channels to the initiator and the responder, whereas in the concrete realization the distribution is sequential: one role receives two encrypted copies of the key and forwards one copy to the other role (Section 4). The abstract view represents the essential structure of server-based key distribution. The forwarding is just an implementation detail.
Third, we show how refinement can be used to develop protocols that are secure under a Dolev-Yao intruder model (at Level 3). In contrast, in related work such as [15,17,24,42], the authors do not continue the refinements down to the level of a standard Dolev-Yao model based on an algebra of cryptographic messages; some use ad-hoc, protocol-dependent intruder definitions. This makes it difficult to compare their models with existing work on protocol modeling and verification and to know for which adversaries their properties hold.
Fourth, we show how to develop an entire family of key transport protocols from requirements down to protocols that are secure against a Dolev-Yao intruder. We model realistic features that are often abstracted away, such as replay prevention caches for timestamped messages that achieve strong properties like injective authentication. We have formalized all models and proofs in this paper in the Isabelle/HOL theorem prover. Our formalization includes an general, reusable infrastructure with Isabelle/HOL theories for protocol runs, fresh values, and channels with security properties. Our complete development including the infrastructure theories is available online [64]. Our development shows that our method scales to protocols of realistic complexity. The protocols in our development share both structure and properties as the graph of refinements of our development indicates (see Fig. 5). Property preservation through refinements avoids proof duplication and fosters well-structured proofs.
Our final contribution is a comprehensive definitional extension of Isabelle/HOL with a theory of refinement that is based on simulation and borrows elements from [2,4]. We define an implementation relation on models including a notion of observation, derive proof rules for invariants and refinement, and show that refinement is a sound method for establishing the implementation relation between models.
This article is based on [62,63]. The main difference is that we have extended our method with a stronger attacker who is able to compromise secrets. As a consequence, we obtain stronger security guarantees. This required modifications throughout the refinement tree. At the top-level, we added new events modeling the leakage of messages. At the lower levels, this required the modification of guards, the generalization of simulation relations, as well as the adaptation of several invariants. Moreover, we were able to shift several invariants from L3 to L2 and reduce their overall number, which further highlights the use of our approach to prove properties at the highest possible level of abstraction.
Organization. The remainder of this paper is organized as follows. In Section 2, we introduce Isabelle/HOL, notational conventions, and summarize the theory of refinement that we have embedded in Isabelle/HOL. In Section 3, we present our four-level refinement strategy for security protocols and illustrate its application by deriving two simple authentication protocols. In Section 4, we report on our development of a family of key transport protocols. In Section 5, we further discuss related work and we draw conclusions in Section 6.
Isabelle/HOL and notation
Isabelle is a generic, tactic-based theorem prover. We have used Isabelle’s implementation of higher-order logic, Isabelle/HOL [57], for our developments. HOL can roughly be seen as logic on top of a functional programming language. We assume that the reader has basic familiarity with both logic and typed functional programming. Proof automation in Isabelle is supported by a rewrite-based simplifier and a tableau procedure. These are invoked in isolation or combined using proof tactics.
To enhance readability, we use standard mathematical notation where possible and blur the distinction between types and sets. We also drop typing information unless it is essential to understand a definition.
We use two definitional equalities: ≡ for terms and ≜ for types. We define partial functions by
Refinement theory
A development by refinement starts from a set of system requirements and environment assumptions. We then construct a series of models resulting in a system that fulfills the requirements provided it runs in an environment satisfying the assumptions. We summarize the refinement theory that we developed in Isabelle/HOL. It is inspired by [2,4].
Specification and implementation
We define the structure of our models and we formalize the meaning of implementation.
A specification is a triple of the form
The definition of transition systems is standard. The observation function
We will work with structured specifications, where the state space Σ is a record type, i.e., a set of tuples of state variables, and the transition relation → is a finite union of parametrized relations, called events. Events have the form
Consider an abstract file transfer protocol specification
The set of behaviors of S,
We say
The mediator function specifies how to abstract observations of
Suppose
Proposition 2.4 guarantees a well-defined notion of property preservation for a series of implementations. We use refinement as a proof method to establish implementations.
Refinement
Our notion of refinement is based on standard simulation [48], which we extend to account for observations [3]. Figure 1 illustrates the second and third point of the following definition.

Refinement of events (left) and observations (right).
We say Each concrete initial state is related to some abstract initial state, i.e.,
For each concrete event R respects observations mediated by π, i.e., for all
We say
In our method, new concrete events usually refine the abstract
Let the concrete and abstract system have state variables
Refinement is reflexive and transitive. Moreover, refinement is a sound (but incomplete [2,43]) method to establish implementation.
We have (i)
(Soundness of refinement ).
If
The combination of Propositions 2.4, 2.6, and 2.7 ensures that requirements and assumptions, once established as external invariants, are preserved by subsequent refinements. Note that this does not generally hold for internal invariants. For later reference we state the following corollary.
(Invariant preservation II ).
Suppose
We define a “protocol” implementing the file transfer specification
Let us try to establish a refinement between
In further refinements, one could develop a more realistic implementation, for example, by eliminating non-determinism and by modeling a communication medium such as an unreliable channel with acknowledgement messages.
We now present our framework for security protocol development by refinement. Each development starts by defining the system requirements and the environment assumptions. The environment assumptions include the attacker model and the cryptographic setup. Given these elements we need a refinement strategy telling us in which order to incorporate them into our models. The crucial point is that requirements and assumptions, once modeled, are preserved by subsequent refinement steps (Corollary 2.8).
The following four-level refinement strategy guides our developments, where each level may itself consist of several refinement steps.
Security properties. We give abstract, protocol-independent specifications of secrecy and authentication properties. The models’ states contain just enough structure to formulate these properties as invariants and define a few abstract events satisfying these invariants. Guard protocols. These are abstract protocols without message passing. We introduce protocol roles, local states of agents, and basic protocol steps. Agents read data directly from other agents’ local states, whereby guards enforce the data’s security properties. Channel protocols communicate over abstract channels with security properties, such as confidential and authentic channels. The intruder may eavesdrop messages on non-confidential channels and fake messages on non-authentic channels. No cryptography is used. Cryptographic protocols. The messages on the abstract channels from Level 2 are now implemented using cryptographic messages sent over insecure channels. A standard Dolev-Yao intruder completely controls the network.
Several explanations are in order. First, while we formulate secrecy and authentication as Level 0 models and establish them by refinement, we express and prove other security properties such as key freshness as invariants. Second, in our setup, agents, keys, nonces, and timestamps have different types and we use variables of these types in our protocol models. However, other options are available. We can easily formalize protocols in an untyped fashion in our framework by using only message variables, which represent arbitrary messages. Finally, the guarantees we obtain in our framework hold for an unbounded number of protocol instances.
Entity authentication protocols
To illustrate our methodology, we develop two unilateral authentication protocols. Both protocols are based on a standard challenge-response pattern, where the initiator sends a nonce as a challenge to the responder who returns it in a cryptographically transformed form that authenticates him to the initiator. The first protocol is the signature-based two-pass ISO/IEC 9798-3 standard [35]. The second, which we call NSL/2, consists of the first two steps of the Needham-Schroeder-Lowe protocol [40] and uses public-key encryption.
We start by specifying the system requirements and by making our assumptions about the environment explicit. Our notion of entity authentication is based on the strong property of injective agreement [41]. A protocol satisfies this property, if given two roles r and The protocol has two roles, which we call initiator and responder. The initiator injectively agrees with the responder on the initiator’s nonce and possibly on additional data.
The intruder controls the network. He receives all messages sent and he can build and send messages composed from their parts obtained by decomposing received messages using the cryptographic keys he knows.
An arbitrary fixed subset of agents is corrupted, whereby their long-term keys are exposed to the intruder.
The requisite cryptographic keys are distributed prior to protocol execution.
Development overview. Figure 2 summarizes the refinements in our development in a refinement graph. Each node represents a model and each arc

Refinement graph for authentication protocols.
We progress from the initial model
We describe our formalization of atomic messages: agents, keys, nonces, and numbers. We start by defining a type of agents,
We also need a mechanism to generate fresh nonces and keys. We assume a type
Finally, we define the type
Many protocols assume a setup of long-term keys, which is established out-of-band before the protocol starts. We model this by assuming an abstract (uninterpreted) key setup
Level 0 – Security properties
We present abstract, protocol-independent models of secrecy and authentication and we formalize and prove their relevant properties as external invariants. Each protocol development starts with the formalization of the protocol’s security requirements. This is achieved by appropriately instantiating these Level 0 models. We will later show that our guard protocol models at Level 1 refine these instantiated models, thus establishing the respective requirements (by Corollary 2.8).
Secrecy
Our first model abstractly formalizes secrecy including a notion of dynamic compromise. We introduce three state variables. The first two,
Events. This model has events for secret generation, for learning secrets, and for leaking them to the intruder. The secret generation event is parametrized by the data d, an agent A, and the intended group of agents G sharing d.
In the secret-learning event, an agent B learns the secret d provided he is authorized or d has leaked.
Let
Our notion of authentication is based on Lowe’s agreement [41]. Informally, a role r non-injectively agrees with the role
We formulate two models,
Non-injective agreement states that if the agents in h are honest and there is a
Injective agreement strengthens this by requiring that the number of
Events. The models
The model
It is easy to see that
The models
Since the variable Our example development starts with a formalization of the main security property: entity authentication by injective agreement ( This model is very abstract. Further refinement steps are needed to obtain a protocol that is executable in the intended distributed environment and is secure against a Dolev-Yao intruder as described by the environment assumptions.
Other types of security property specifications
In contrast to establishing security properties by refinements of L0 models, we may express (and prove) security properties directly at the protocol level (i.e., at Level 1, 2, or 3) in one of two ways.
First, the property may be ensured by a guard, whereby the property is established by construction so that no extra proof is required. An example is a guard checking the validity of a timestamp to ensure the recentness of an associated session key. Second, we may formulate and prove the property as an external invariant of the protocol. This is how we express the freshness of session keys. An advantage of using the refinement of abstract models over these two alternatives is that the abstract models are protocol-independent. This enables clear and uniform property specifications. In contrast, invariants that are formulated at the protocol level (see, e.g., [58]) must be specified individually and tend to be more complex.
Level 1 – Guard protocols
We now introduce protocol roles and runs. A run is a thread executed by some agent in a given role. Each run has a local memory holding state information. At this abstract level, runs share information by reading each other’s memory. We call such protocols guard protocols. Of course, this kind of communication by reading another thread’s memory is unrealistic in a distributed setting. Hence, at Level 2, we will refine this abstract form of communication by passing messages over communication channels.
State
Guard protocols have at least one state variable,
Events
Each event executes a protocol step of a run by an agent in a particular role. The sequencing of events within a role is determined by local guards reading a run’s local store. For example, the guard
(Abstract authentication protocol, part I ).
The state
Let
Agents communicate by reading their peers’ memories. This is achieved by non-local guards that refer to another run’s store. Such guards read remote values that may be compared with local values and used in local state updates. We have two kinds of non-local guards: authorization guards for secrecy and authentication guards for agreements. Authorization guards prevent unauthorized agents from learning secrets. We will explain the shape of these guards in Section 3.4.3 below.
An authentication guard for a given list of agents h and data d (cf. Section 3.3) executed by a run R requires the existence of a run
Since authorization and authentication guards are related to security properties, we also call them security guards. There are also local security guards, which do not refer to other runs’ local store. For example, such a guard may check the validity of timestamps to achieve recentness. Note that at this level of abstraction, the intruder is passive and The third step refines (
Refinements
We establish the secrecy and authentication properties of our guard protocol models by refining appropriately instantiated secrecy and authentication models from Section 3.3. Below we give general patterns for establishing secrecy and authentication properties. In each case, we establish a refinement by reconstructing the abstract state (i.e., the knowledge and authorization relations
Secrecy. We establish secrecy by refining the model
We can now explain how authorization guards are stated in terms of
Authentication. We similarly refine
In general, for an agreement of agent A in role r with B in role
In contrast to secrecy and authentication, we will formulate key freshness as a state predicate and establish it as an invariant of guard protocols (see Section 4.4.4). Let Note that, in general, the abstraction function At this point we can state and prove the refinement result, which establishes the entity authentication requirement
We have now satisfied both system requirements: injective agreement ( (
At Level 2 of our refinement strategy, we introduce protocols that use communication channels with associated security properties. These channels carry plain text messages without cryptographic operations. We also introduce an active intruder acting in this distributed environment.
Channel messages
For informal use, we adopt the notation of [45] (second column of Table 2). We write
Channel notation, messages, and conditions for extraction and faking
Channel notation, messages, and conditions for extraction and faking
We formalize the channel messages that can be transmitted by a data type
Static channel messages name the sender and the receiver. For dynamic channel messages, names are replaced by a key, which determines access to the respective channel. Therefore, the agent names in the informal dot notation for dynamic channels (e.g., in
In our formal developments, we use the abbreviations given in the third column of Table 2. For example, we define
Based on the security attributes of channel messages, we define the intruder capabilities for eavesdropping (or extracting) payload messages and for faking channel messages, indicated in the final two columns of Table 2. We formalize these intruder capabilities as two functions:

Rules defining extractable atoms.

Rules defining fakeable channel messages.
The mild technical condition
The astute reader may be surprised that the intruder does not need to know a key to read from an authentic dynamic channel or write to a confidential dynamic channel. This situation differs from Dolev-Yao-style perfect cryptography. For example, verifying a MAC or signature requires a (shared or public) key. However, the key is typically only required for verifying the authenticity of the message and not for giving access to the authenticated message itself. Likewise, producing an encryption in a Dolev-Yao model requires a key. However, there are encryption schemes such as stream ciphers where the intruder can produce valid ciphertexts without knowing the encryption key. Similarly, it may be surprising that we allow the intruder to (i) eavesdrop messages on confidential channels with a dishonest sender and (ii) send messages on authentic channels with a dishonest receiver. Disallowing these behaviors would preclude implementations of these channels using symmetric cryptography, for instance, realizing an authentic channel using MACs.
Channel protocols extend the state of the guard protocol they refine with a variable
The protocol events use guards of the form
Channel protocols include an active intruder event, which closes the set of channel messages under fakeable messages.
The refinement of the abstract Level 1 model just extends the state record with the variable The high level of abstraction of guard protocols allows many different realizations. Recall from the overview in Section 3.1 that we have also refined the model The state The intruder event Let
Let
By using abstract channels, we retain the possibility of different cryptographic realizations. For example, we may realize the authentic channels using signatures or MACs. (
We model concrete protocols and the Dolev-Yao intruder using a standard theory of cryptographic messages due to Paulson [58]. At this level, messages are transmitted over insecure channels.
Cryptographic messages and setup
The type of messages,
We can also concretize the previously declared abstract setup of cryptographic keys,
To formalize protocol properties and the intruder, we use the standard closure operators
State and events
Cryptographic protocols replace the channel messages
Protocol events receive messages by using guards of the form We now refine the abstract protocol model The state We restrict our presentation to the second protocol step, (
Refinement
The refinement of channel protocols by cryptographic ones is based on a protocol-dependent message abstraction function
The relation
When modeling session key compromise, it may be necessary to generalize this simulation relation, in particular the relations
In the refinement proof for the intruder events, a variant of the following action refinement The simulation relation in this refinement is The refinement proof only requires one internal invariant expressing the secrecy of the private signing keys.
We can now state the refinement result relating this model of the ISO/IEC 9798-3 protocol to the abstract channel model
Let
We have presented our four-level refinement strategy along with its supporting infrastructure. We have illustrated our approach with the development of simple entity authentication protocols. This resulted in two different concrete protocols at Level 3: ISO/IEC 9798-3 and NSL/2. We satisfied all system requirements by proving properties of the abstract model at Levels 0 and 1. As these models are not directly implementable, we continued our refinements, thereby obtaining models that are suitable for an implementation in the intended hostile distributed environment and, crucially, inherit the properties we proved for the abstract models. The simulation relation and invariants used here at Levels 2 and 3 are canonical for our refinement strategy (cf. Section 4). We would like to emphasize that a number of alternative cryptographic realizations of the channel protocols are possible, for example, using symmetric encryption or MACs. Our approach fosters abstraction and enables the sharing of structure and proofs.
Key establishment protocols
In this section, we validate our refinement approach by developing a family of key establishment protocols, including the Needham-Schroeder Shared Key (NSSK) protocol, core versions of the Kerberos 4 and 5 protocols, and the Denning-Sacco protocol. Compared to the running example from Section 3, our protocol models feature additional elements such as timestamps, replay caches, dynamic channels, and a changing communication structure. We also prove additional security properties related to session keys, such as key confirmation, key freshness, key recentness, and session key compromise.
Requirements and assumptions
Our informal requirements and assumptions for (server-based) key establishment protocols follow below. The first three requirements are mandatory and must be satisfied by all protocols we consider. The last three requirements are optional. We will formalize these requirements in subsequent sections.
The server generates and distributes a fresh session key to an initiator and a responder.
Only authorized agents may learn a session key K, unless one of them is dishonest or the key K has leaked whereby other agents may also learn it.
The next two requirements cover authentication properties, which we will formalize in Section 4.3 as injective or non-injective agreements.
The initiator and the responder each authenticate the server on the session key and possibly on additional data.
The initiator and the responder authenticate each other on the session key and possibly on additional data, thereby confirming to each other their knowledge of the key.
Two additional (and independent) requirements concern the freshness and recentness of the session key. A key is fresh if it is only used in a single session and is recent if its lifetime does not exceed a specified limit.
The initiator and responder obtain assurance that the session key is fresh.
The initiator and responder obtain assurance that the session key is recent.
The environment assumptions Session keys may leak to the intruder.
Development overview
We concretize our refinement strategy for deriving different server-based key establishment protocols: the Needham-Schroeder Shared-Key (NSSK) protocol [53], the Denning-Sacco protocol [31], and a core version of Kerberos 4 [65] and Kerberos 5 [54] with one instead of two servers. In these protocols, the initiator requests a session key from the server for use with a given responder. We derive different variants of these protocols. In the simplest variant, the server responds by sending encrypted copies of the session key directly to the initiator and the responder. In the original protocols, the server also sends the responder’s encrypted key, called a ticket, to the initiator who forwards it to the responder. The ticket is either encrypted inside the message containing the initiator’s copy of the session key (NSSK, Denning-Sacco, and Kerberos 4) or sent alongside that message (Kerberos 5). Moreover, in the NSSK and Kerberos 4 and 5 protocols, the initiator and the responder exchange two additional messages for mutual key confirmation. After this overview, we will focus on the core Kerberos 4 and 5 protocols in the remainder of this section. Figure 12 on page 108 depicts a message sequence chart of these protocols.
The refinement graph in Fig. 5 summarizes our development. Recall that each node represents a model and each arc
At Level 0, we have the abstract models of secrecy (
In the first stage, we refine

Refinement graph.
In the second stage, we refine the model
At Level 2, we construct the three channel-based models,
At Level 3, we replace the channel messages by cryptographic messages sent over an insecure channel. We implement the static secure channels by symmetric encryption with long-term keys and the dynamic authentic channels by encryption with the session key. The models at this level differ in their handling of the responder’s ticket. In models with names ending in d (for direct), namely,
L3 models and their properties
Table 3 summarizes the requirements achieved by the final protocols. In the columns for the authentication requirements

Details of refinements in the Kerberos development.
Based on the modeling and reasoning framework and the infrastructure from Section 3, in the following sections we develop concrete models at each abstraction level. We focus on the models typeset in boldface in Fig. 5 that lead to the core versions of Kerberos. Figure 6 provides an overview of most refinements between these models and the related propositions. State spaces (without variable types) and simulation relations are displayed on the left-hand side, observations and mediator functions on the right-hand side, and observation functions are shown as left-to-right arrows. Triples of the form
We start our development by formalizing the security requirements. We formalize each secrecy and authentication requirement as an instance of the corresponding L0 model from Section 3.3. We will later show that our guard protocol models (L1) refine these instantiated models, thus establishing the respective requirements (by Corollary 2.8). We will formalize key recentness directly as a guard and key freshness as invariants of Level 1 protocols and therefore discuss these later in Section 4.4.
Secrecy. The instantiation of the polymorphic type of data of the model

Authentication graph for Kerberos.
Authentication. We formalize the Requirements
To prove that an L1 model establishes an agreement of role r with role
In our server-based key transport protocols, there are three roles: a key-generating server and key-receiving initiators and responders. The state records runtime information about the execution of these roles and the set of leaked keys as described in Section 3.4.
Secret key distribution
A sequence chart of our first abstract key transport protocol model,

Basic secret key distribution (
Before presenting the events of the specification
We define the relation
The following rule defines who is authorized to learn a session key that the server
The specification
The second guard is an authorization guard requiring that B is authorized to learn
Finally, the leak event compromises the session key generated by a server run and records it in the variable
Instantiating the simulation relation
Let
Since the abstract variables
We now refine the model

Adding server authentication (
We obtain the model
Second, we realize the agreements described above by adding authentication guards to the key-receiving Steps 4 and 5. These guards may be added directly to the respective events or discovered during the refinement proof of the
For the refinement of
Next, we prove that the server’s event

Adding key confirmation (
For
Finally, it is easy to see that
We next extend the model
We define the state of
The events for Steps 1–5 of the model
In the initiator’s Step 4, we add the initiator’s timestamp
In the responder’s Step 5, we also add
We also add a new Step 6 to the initiator, which uses an authentication guard to achieve agreement with a responder run
Finally, we modify the
The mediator function
The mediators
(i)
Finally, we formalize key freshness (
All cases except for the critical Step 5 by the responder are proved automatically. The proof of Step 5 relies on other invariants proved for
As described in Section 3.5, at Level 2, we extend the state with a field
For the refinement of

Channel-based Kerberos protocol (
The channel-based refinement
As example events, we describe the changes in Steps 3 and 5. In the server’s Step 3, we add an additional guard for receiving message M1 and an action for sending messages M2a and M2b.
In Step 5, the responder B receives message M2b from the server and M3 from A and sends message M4. Here, the message-receiving guards replace the previous authorization and authentication guards.
We can now prove several invariants related to session key secrecy and compromise. The following invariant expresses that the addition of a set of keys
This is the L2 equivalent of the session key compromise invariants in [58].
A group of three invariants express the session key’s secrecy from each role’s point of view. More precisely, these invariants state that the intruder can extract a session key only if it has leaked from a session context matching the role’s context (i.e., its frame and any fresh values it might have generated). In the case of the initiator, this invariants reads as follows.
The refinement proof also requires invariants related to authentication. These are directly suggested by the guard strengthening proof obligations stating that the message-receiving guards at Level 2 imply the security guards at Level 1 (cf. Example 3.8). This is one of the main benefits of using guard protocols as a link between the properties and the message-based protocols.
We can now state the following refinement result. Appendix C contains a proof sketch of guard strengthening for Step 5.
Let
As described in Section 3.6, in our setup at Level 3, each agent A shares a long-term symmetric key
The simulation relation
By refining the channel-based intruder into a standard Dolev-Yao intruder, as described in Section 3.6, we also establish Assumption

Cryptographic core Kerberos protocols.
Figure 12 shows the core of Kerberos 4 [65] and Kerberos 5 [54]. We implement the static secure channels by encryption with the long-term keys and we refine the dynamic authentic channels into encryptions with session keys. (In the Dolev-Yao model, symmetric encryption also provides authenticity.)
We also modify the communication topology of the channel-based model: The initiator now relays the responder’s ticket from the server. While in Kerberos 5 the ticket is sent alongside the ciphertext containing the initiator’s session key, it appears inside the ciphertext in Kerberos 4. We now present our models of Kerberos 5 and Kerberos 4,
We focus on the refinement of Steps 3–5, which reflect the modified communication topology. In Step 3, the server sends the message M2 by adding it to
The message abstraction function,
The refinement proof requires only two additional invariants. The first one, called
Let
In the core Kerberos 4 protocol, the responder’s ticket is encrypted inside the initiator’s message from the server. Hence, message M2 is modified as follows.
The refinement proof for
We then prove:
Let
Overall security guarantees at Level 3
Having gone through a number of refinements, the reader may wonder at this point what is the precise relationship between the secrecy and authentication properties proved as invariants at Level 0 and the final models at Level 3. The answer is given by Proposition 2.6 and Corollary 2.8, which state that refinement is transitive and that external invariants (such as the secrecy and agreement invariants of
As an example, consider the series of refinements in Fig. 6: we have refined the secrecy model
The second part, the mediator function
In a similar way, we can express the authentication results directly as properties of
For the initiator, we have
We complete the picture by stating the authentication guarantees for the responder with the server and with the initiator.
For the responder, we have
Summarizing, given a security property P proved as an external invariant of a model S (e.g., at Level 0) and a series of refinements of S into a model
We summarize some statistics from our developments in Table 4, which has entries for five groups of theories. For each group, we indicate the number of definitions and lemmas that we formalized in Isabelle/HOL, the number of lines of the corresponding theory files, and the CPU time. The times are for proof checking only and do not include the generation of a session image or the documentation. The measurements were made on a 2.6 GHz Intel Core i7 laptop with 8 GB RAM running Isabelle/HOL 2016-1.
Overall specification and proof statistics
Overall specification and proof statistics
The first group consists of 11 infrastructure theories, which support our method, and includes our general theory of refinement (Section 2.2) and our infrastructure for security protocol modeling and refinement including the L0 models of secrecy and authentication (Section 3). These theories can be reused in other developments. The second group consists of the L1 models
Detailed proof statistics: lemmas, inductive/derived/inherited invariants, and refinements
Table 5 shows more detailed proof statistics for the models used in our development of the Kerberos 4 and 5 protocols and the NSSK protocol. In particular, the fourth column lists three numbers for invariants. The first number denotes inductive invariants, which are proved by induction and primarily used to strengthen the simulation relation in refinement proofs. One type of (internal) invariant, which we find in many models at Levels 1 and 2, are key definedness invariants. These state that session keys are only generated by existing runs, i.e., the run R of a used session keys
As mentioned earlier, all system requirements are already established at Level 1, mainly in the form of refinements of L0 models. Exceptions are key freshness properties, which are formulated as invariants. There is one other new invariant at Level 1, which states a property of the cache in the abstract Kerberos model
The largest number of invariants is required at Level 2. These invariants can be classified into two groups: those concerning session key secrecy or compromise (6 each for
The invariants remaining at Level 3 mainly concern details introduced at that level. Examples are the secrecy of long-term keys, an invariant about the shape of forwarded tickets that are encrypted with an honest agent’s long-term key (
There have been other proposals for developing security protocols by refinement using various formalisms such as the B method [17], its combination with CSP [24], Event-B [16], I/O automata [42], and ASMs [15]. None of these continue their refinements to the level of a full Dolev-Yao intruder. Either they only consider an intruder that is passive [42], defined ad-hoc [15,16,24], or that corresponds to our L2 intruder [17]. This makes a comparison of their results with standard protocol models difficult. Moreover, these works do not propose a uniform and systematic development method as we do with our four-level refinement strategy and most of them develop individual protocols rather than entire families.
Several authors have studied protocol transformations within the cryptographic level, L3. Hui and Lowe [34] define a family of syntactic transformations and prove their soundness. Nguyen and Sprenger [55,56] extend this work to the untyped case and to equational theories. The focus of these works is on improving the performance of automatic verification tools rather than on protocol development. Guttman [33] studies a rich class of protocol transformations in the strand space model and proves their soundness. His approach is based on the simulation of protocol analysis steps instead of execution steps. Each such analysis step explains the origin of a message. Datta et al. [29] prove properties of protocol classes specified using messages containing function variables. Refinement here means instantiating function variables and discharging the associated assumptions. Pavlovic et al. [26,59] propose a logical approach to proving such refinements. However, the soundness of these refinements is not formally justified. In contrast to our approach, the transformations discussed in this paragraph do not involve a fundamental change of the abstraction level as they all work with cryptographic messages (Level 3).
Abstract channels with security properties and their transformations were studied by Maurer and Schmid [45]. Boyd has formalized analogous results using Z [20]. Bieber et al. [18] model abstract channels using the B method and refine them to cryptographic implementations. Abadi et al. [1] formalize secure channels in a process calculus and establish full abstraction results for translations to cryptographic implementations. Several works have investigated the use of abstract channels to model and verify layered protocols, e.g., an application protocol running on top of a protocol establishing a secure channel (such as TLS). Bella et al. [12] explore the modeling of such layered protocols based on channel abstractions in Paulson’s inductive approach [58]. Kamil and Lowe [37] prove the soundness of such channel abstractions under certain independence conditions and show in [38] that TLS satisfies these conditions. Mödersheim et al. [32,49,50] propose a compositional approach, where the protocols implementing the channel and the (possibly cryptographic) application protocol can be verified separately. Their objective is to provide composition theorems guaranteeing that, under certain disjointness conditions, security properties are preserved by layered composition. In contrast, our focus in on refining channel protocols into concrete cryptographic protocols.
Classical notions of refinement (such as simulation) do not preserve information-flow properties, since they involve a reduction of non-determinism, which can destroy secrecy. Several works address this problem, known as the refinement paradox, for example, [5,36,44,46]. Morgan and McIver [46,51,52] solve the paradox by explicitly recording the set of possible values of secret variables. These sets represent the intruder’s ignorance and refinements may extend, but never reduce them. Cortier et al. [27] show that strong secrecy is equivalent to reachability-based secrecy (used here), if the secrets are not tested. Key establishment protocols that include a key confirmation phase (such as such as Kerberos and NSSK) do not satisfy this condition.
Simulation-based security [7,25] is a paradigm for specifying idealized functionalities and implementing them using a notion of secure emulation. Delaune et al. [30] have proposed a symbolic version of this paradigm, which can be understood as a form of compositional refinement. The compositionality comes at the price of requiring an public-key encryption/decryption functionality and proving a joint-state theorem. As an example, they derive the Needham-Schroeder-Lowe protocol. The modeling of encryption as a service considerably reduces the abstraction level of these models compared to the standard symbolic representation as a term constructor.
Our most concrete models are still quite abstract when compared to a protocol implementation in a programming language such as C or Java. The work by Polikarpova and Moskal [60] can be seen as an extension of our refinement levels with two additional levels leading towards an implementation: one in which the messages are replaced by bitstrings and one that represents the real implementation. The refinements are encoded and proved in the general-purpose C program verifier VCC.
Isabelle/HOL has been used in several approaches to post-hoc security protocol verification. Paulson [58] uses induction to define the protocols’ event traces and verify their properties. We reuse his Isabelle/HOL theory of cryptographic messages including the closure operators
Several other researchers have analyzed Kerberos. Bella and Riccobene [15] develop Kerberos 4 in three refinements using ASMs. They use a non-standard attacker model and prove mostly liveness properties (for example, all runs reach a specific state) instead of secrecy and authentication properties. Bella and Paulson model BAN Kerberos [14], Kerberos 4 [13], and Kerberos 5 [11] including session key compromise using the inductive approach [58]. However, they do not model a replay cache and prove only non-injective agreements. Butler et al. [22,23] constructed detailed models of Kerberos 5 using multiset rewriting. These models include cross-realm authentication and other realistic features such as options, flags, and error handling. They manually construct their models and proofs in several “refinements” to keep them manageable. However, their notion of refinement is informal.
Conclusions
Our development provides strong evidence that refinement supports the systematic understanding and development of families of protocols. The abstract models help the developer to focus on the essentials: In our case studies, we have established all requirements on guard protocol models (L1), which contain neither messages, communication channels, nor intruder events. Our refinement strategy guides the developer towards the concrete levels that account for the environment assumptions, namely, the distributed environment controlled by a Dolev-Yao intruder. The abstraction levels of our refinement strategy are reflected in well-structured proofs of correctness, where the simulation relations used are either fixed (a projection at L1–L2) or systematically derived (for example, abstraction of runs to signals at L0–L1 and cryptographic to channel messages at L2–L3). Our case studies also show that our development strategy and tools scale to realistic protocols with non-trivial features. Our approach may also help in the standardization of security protocols [9,10]. Standards frequently include several variants of a protocol, for example, designed for different cryptographic setups or using different forms of key establishment (e.g., key transport versus Diffie-Hellman key agreement). Here, one could use our method to identify an abstract protocol model capturing the commonalities of the different variants and prove their properties once and for all. The different concretizations can then be obtained by refinements.
A central part of this work has been the development and exploitation of guard protocols, which form the bridge between security properties and channel protocols, i.e., from the “what” to the “how”. Security guards realize properties abstractly. Moreover, they substantially simplify proof construction. They give rise to invariants in a canonical way during refinement, thereby facilitating invariant discovery. These invariants strengthen the simulation relations in the refinement proofs.
Our channel protocol model is quite simple and protocol messages with nested cryptographic operations or undecryptable message parts have no direct representation. This excludes modeling, for example, messages containing certificates, the forwarding of undecryptable messages, and nested encryption (NSSK and Kerberos). Our experience has convinced us that this simplicity is a virtue rather than a limitation. Our models of server-based key transport protocols naturally reflects their actual (star-shaped) security architecture. We view forwarding and double encryption as implementation techniques, to be dealt with at the final level. Our developments show that this is possible. Such abstractions are even more beneficial for developing new protocols. From this perspective, certificates provide an abstract authentic channel from the certification authority to the agent verifying the certificate’s content and encrypted and signed messages are just one way of implementing a secure channel.
Future work. We ultimately envision a tool-based development process where engineers can choose standard properties and follow high-level recipes for building guard, channel, and crypto protocols, with tools checking their steps along the way. To achieve this, we will work into two directions. First, we want to extend the range of protocols that can be modeled and reasoned about. For example, we plan to add support for Diffie-Hellman key agreement, compromising adversaries, and more complex properties such as perfect forward secrecy, possibly along the lines of [8]. Recent work in this direction is [39], which in addition to session key compromise also covers different forms of dynamic agent compromise. Second, we would like to automate development based on our strategy. It should be possible to derive protocol models directly from high-level descriptions such as the authentication graphs of Fig. 7 and sequence charts of Figs 8–10. Moreover, with suitable infrastructure it should be feasible to automatically generate and (as far as possible) prove invariants and simulations, given their strong regularity.
Footnotes
Acknowledgments
We are grateful to Jean-Raymond Abrial for fruitful discussions in the early stages of this work. We would also like to thank Ivano Somaini for developing parts of the Isabelle/HOL theories, the anonymous reviewers for their useful feedback, and Martin Vechev, Vincent Jugé, Son Thai Hoang, Eugen Zălinescu, Binh Thanh Nguyen, Ognjen Maric, and Andreas Lochbihler for their helpful comments on earlier drafts of this paper.
Definitions of synth,analz,and parts
For completeness, we include the definitions of the closure operators
The rules in Fig. 14 define the decomposing closure operators
Proof of Step 5 in Proposition 4.5 (ii) (L1)
We sketch the proof of guard strengthening that arises in the refinement of the abstract event
Proof of Step 5 in Proposition 4.7 (ii) (L2)
The guard strengthening proof obligation for the responder’s
The following invariant directly arises from the proof obligation expressing the strengthening of the server authentication guard (9). It expresses the guarantee that an honest B gets about the server’s state from receiving message M2b.
The strengthening of the initiator authentication guard (10) corresponds to the following proof obligation. It describes the authentication guarantee that the responder B gets about the initiator A’s state from receiving messages M2b and M3.
When trying to prove that this is an invariant, we get stuck in a proof state that suggests replacing the honesty of A and B by the secrecy of
To establish the guard strengthening (11) using the invariants
